Tuesday, September 16, 2008

Create prompt for Months using 'is Between' Operator


Often user wants to create prompt for Month and it should display like 'Sep 2008','Oct 2008'
But what happens if you also want to apply 'is between' operator ?

Because you can't apply 'is between' operator on month that have varchartype. Therefore, how can sql take care of 'between' clause on Varchar datatype .

But you can achieve this functionality using two month prompt and presentation variable.

- Create two month prompt          (like Current_Month and End_Month )
- Add presentation variable on both prompt   ( VarCurrMonth and VarLastMonth)




-  Create another report in answer that includes below columns :
  • Calendar Month
  • MIN( RMIN(Calender Date))
  • MAX( RMAX(Calender Date))
apply filter on Calendar Month using "OR" operation and Presentation Variable

- Save Report in your Shared Folder with name like - "Month between another request" report
-Go to your main report that contains date column and Apply filter using 'Based on another   request' functionality. then select "Month between another request" and set column filter twice as below :
  •   First for Greater than or equal to MIN( RMIN(Calender Date))
  •   Second for Less than or equal to MAX( RMAX(Calender Date))



Cheers !!!!!!!!!!!!!


Regards,
Devendra Chhajlani

1 comment:

AinulNaim said...

hai..

1. thus the prompted using 2 different field? - Calendar Date & Calendar Quarter.

2. The presentation variable can just create via answers? or we have to create at the Administrator Tools presentation section?