Hello Friends,
I need to show the last 30 days data from the selecting date on words in cognos8.4 report studio
ex: I selcted date as 01-06-2009 then My report out put between 29-05-2009 and 1-06-2009.
can any one please help me how to resolve this.
build a filter using the _add_days function on the parameter value that is associated with the date prompt:
[some_date] between _add_days(?dateparameter?,-1) and _add_days(?dateparameter?,30)
You may need to cast the ?dateparameter? to a datetime first
Hi.
After to you build your crostab with your dimensions,try this:
1. From your insertable objects, select to object value prompt until your work area.
2. In the properties pane, specify a range of values (to tgis objects), set the range property to YES.
3. from data menu, click filters.
4.change the operator to one of the following, for example:
change the operator to in_range
[product_line] in_range ?product line?, where product_line is the name of the data item, allows user to specify a margin range.
5. click ok.
it's all.
Quote from: technol on 14 Oct 2009 08:16:15 AM
Hi.
After to you build your crostab with your dimensions,try this:
1. From your insertable objects, select to object value prompt until your work area.
2. In the properties pane, specify a range of values (to tgis objects), set the range property to YES.
3. from data menu, click filters.
4.change the operator to one of the following, for example:
change the operator to in_range
[product_line] in_range ?product line?, where product_line is the name of the data item, allows user to specify a margin range.
5. click ok.
it's all.
Technol, in what way does your solution relate to the posted subject? ???
you can, select a range date for example between 29-05-2009 and 1-06-2009. ;)
Yes, but the OP asks to provide a solution based on the date selected through the prompt. That is not a fixed range, but a filter that relates to the parameter value associated with the prompt..
Besides that issue, where does he state using a crosstab?
Thx Blom,
But Wwhen I a using this [some_date] between _add_days(?dateparameter?,-1) and _add_days(?dateparameter?,30)
I am Geting only 2days data
ex: I selected the parameter date is jun 30 2008 I am geting the data for 29th and 30 th date not for all dates
Please help me is there any other solution
Instead of [some_date] between _add_days(?dateparameter?,-1) and _add_days(?dateparameter?,30)
try [some_date] between _add_days(?dateparameter?,-30) and ?dateparameter?
_add_days(?dateparameter?,30) adds 30 days, while _add_days(?dateparameter?,-1) subtracts a day. I think Blom just got it backwards.
Thanks All....It's working fine
Quote from: PaulM on 15 Oct 2009 02:53:46 AM
Instead of [some_date] between _add_days(?dateparameter?,-1) and _add_days(?dateparameter?,30)
try [some_date] between _add_days(?dateparameter?,-30) and ?dateparameter?
_add_days(?dateparameter?,30) adds 30 days, while _add_days(?dateparameter?,-1) subtracts a day. I think Blom just got it backwards.
Yep, backwards indeed. However the idea was to 'show the way' ;D It is just a matter of looking up the help on how to write the exact expression to ones needs.