If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Switch mechanism

Started by neeleshdeshmukh, 09 Jan 2008 03:36:11 PM

Previous topic - Next topic

neeleshdeshmukh

Hi,

I have a list which I need to filter in a way so that by default it should pick up last 10 days of data(don't want to Hot Code every day). On the report page there are two calender prompts(?Start_Date?,?End_Date?) which users should be able to use after the first run. I need something like a counter or some thing which will changes itself after first run.
What I can do is put a value prompt on the page. Give two static values say, A and B. Let the parameter name be ?Switch?. I can set its default value to be A.
So now in the filter I can say:
(
(?Switch?='A' and [Filter_Date] between _add_days(Current_date,-10) and Current_date) or
(?Switch?='B' and [Filter_Date] between ?Start_Date? and ?End_Date?)
)


This will work when its possible to change the value of that static value prompt to B after first run.

Is it possible with JScript?

Thanks,
Anirudha

Authoress

You may get the desired results by simply adding a filter to your report like this:

trunc([Date])  >= trunc(add_months({ sysdate },-3)) and trunc([Date])  <= { sysdate }

The example gets all rows for the past 3 months. No prompt dates required.

You could use the add_days function to just get rows for the last 10 days. This are Oracle functions, so adjust for another vendor. HopeThisHelps  :)