Changing a view to pull a larger number of documents - Dev noob here

I have a view in a database that reads today’s date and lists some reports that have been submitted for the past two weeks via the method below.

I have been tasked with changing the view so that the View Selection grabs the last 6 months worth of documents instead of just the past two weeks. I would think that I would need some sort of date conversion utility, like todays date - 180 days but I’m not sure how to do it.

Any assistance is greatly appreciated!

Tim

b := @Weekday(@Today) ;

c := @If ( b = 2 ; @Adjust (@Today ; 0;0;-7;0;0;0) ;

b = 3 ; @Adjust (@Today ; 0;0;-8;0;0;0) ;

b = 4 ; @Adjust (@Today ; 0;0;-9;0;0;0) ;

b = 5 ; @Adjust (@Today ; 0;0;-10;0;0;0) ;

b = 6 ; @Adjust (@Today ; 0;0;-11;0;0;0) ;

b = 7 ; @Adjust (@Today ; 0;0;-12;0;0;0) ;

b = 1 ; @Adjust (@Today ; 0;0;-13;0;0;0) ;

  1. ;

d := @If ( b = 2 ; @Adjust (@Today ; 0;0;-1;0;0;0) ;

b = 3 ; @Adjust (@Today ; 0;0;-2;0;0;0) ;

b = 4 ; @Adjust (@Today ; 0;0;-3;0;0;0) ;

b = 5 ; @Adjust (@Today ; 0;0;-4;0;0;0) ;

b = 6 ; @Adjust (@Today ; 0;0;-5;0;0;0) ;

b = 7 ; @Adjust (@Today ; 0;0;-6;0;0;0) ;

b = 1 ; @Adjust (@Today ; 0;0;-7;0;0;0) ;

  1. ;

Subject: Persistence

OK, I think I got it.

SELECT (form = “onsitevisit”) & CallDate >= @Adjust (@Today ; 0;-6;0;0;0;0)

I feel all warm and squishy inside. hahah.

Subject: RE: Persistence

Just be aware: if this database grows to even a moderate size (in terms of number of documents), you’re going to have performance problems unless you set the view so it does not refresh immediately.

Subject: RE: Persistence

And that’s because of the use of @Today in the selection formula, as we should probably tell a self-acclaimed dev noob. :slight_smile:

While @Today is technically correct, the current implementation makes its use rather undesirable. @Today will cause the view index to be always lacking behind. Whenever such a view is opened, Domino will completely rebuild the view index, which is a costly operation (unless you set the view to not refresh automatically, as Rich mentioned, but that’s usually not what users want).

Heck, “current implementation” sounds as if it has ever been different. It has not, but Andre Guirard, head of the Designer team has just recently brought up an idea to improve on the situation.

As Rich stated, the problem will grow with the number of documents to show in the view. So changing from 14 days to 180 days will most probably have a noticeable influence on performance. There are a couple of workarounds for the problem, as this requirement is not too rare. Search developerWorks Lotus (or the internet) for @Today and view index. My personal favorite is to run a LotusScript agent, that modifies the views selection formula programmatically once a day.