COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: saumil287 on 23 Mar 2011 01:05:18 PM

Title: displaying records for last 15 days in column chart
Post by: saumil287 on 23 Mar 2011 01:05:18 PM
Hi all,
I am having a requirement in which the dropdown contains "Last 15 Days" as value on click on the same the chart must display records only for last 15 days.
I tried to create a list report and on date column applied a filter for last 3 years using _add_years which was working but how should I associate this filter with value prompt
Title: Re: displaying records for last 15 days in column chart
Post by: kattaviz on 23 Mar 2011 03:41:51 PM
Hi,

What is the use value for the option "Last 15 Days". Are those static or not? If they are static try to can use function like (_add_days(current_date,-?paramvalue('parameter name').

HTH
Title: Re: displaying records for last 15 days in column chart
Post by: kattaviz on 23 Mar 2011 03:50:08 PM
Hi,

I forgot to mention that give "15" as use value for the option "Last 15 Days" in your prompt.
Title: Re: displaying records for last 15 days in column chart
Post by: ammuk on 23 Mar 2011 11:01:07 PM
If u want to associate with value prompt the only way is to use static choices other wise u can add a calculated column at the time of modelling ur package and u can use that data item with value prompt
and for last 15 days date between cuurent_date and _add_days(current_date,-?p?)
regards
ammuk
Title: Re: displaying records for last 15 days in column chart
Post by: saumil287 on 23 Mar 2011 11:39:52 PM
Hi All
"Last 15 Days" is a static item in dropdown, On click on the same the chart should display the records for last 15 days. I am using Excel as a datasource.
  Thanks
Title: Re: displaying records for last 15 days in column chart
Post by: saumil287 on 24 Mar 2011 02:34:47 AM
Hi All,
I am confused, I tried the steps but showing the blank report.
Can u give me the steps to achieve the same.
Thanks
Title: Re: displaying records for last 15 days in column chart
Post by: kattaviz on 24 Mar 2011 09:41:49 AM
Hi,

Pls run the attached XML specification. This is what i have done.

1) Create a value prompt with 2 static choices.

Use Value  -  Display value
-15                15 Days
-7                  7 Days

2) Create a data item with the following expression.
_add_days(current_date,?Parameter1?)

3) Based on the selection in the prompt page the data item will calculate the days and return the correct date value.

HTH
Title: Re: displaying records for last 15 days in column chart
Post by: saumil287 on 25 Mar 2011 07:41:28 AM
Hi
Can you plz send me the steps,
I am not able to produce an o/p.
I dont know from where to open the excel file.
I want to display a column chart
where booking value as measure,
custname as x-axis,
doc date should only be associate with chart query to filter for last n days

a value prompt should display " last n days" on click on which the data must be displayed in chart
Title: Re: displaying records for last 15 days in column chart
Post by: saumil287 on 25 Mar 2011 07:58:39 AM
hi
one more thing I want to ask, during adding a static choice, should I create a variable or not.
thanks
Title: Re: displaying records for last 15 days in column chart
Post by: kattaviz on 25 Mar 2011 10:07:37 AM
Hi,

See the following link

http://www.ibm.com/developerworks/data/library/cognos/reporting/dynamic_report_design/page553.html?ca=drs-

HTH
Title: Re: displaying records for last 15 days in column chart
Post by: saumil287 on 26 Mar 2011 11:02:51 AM
Hi satish,
I tried from the link which u gave, It is working fine sometimes with hard coded dates but when I try to do the same using current_date, It gives "unable to perform 'sqlpreparedeithoptions' status -16 error.
It is working fine with the list but not with chart, Even If I write the correct syntax, it is throwing syntax error "   between".
Can this be done in other way also.
If yes then plz guide me the same
Title: Re: displaying records for last 15 days in column chart
Post by: saumil287 on 28 Mar 2011 12:52:24 AM
Hi,
one more thing is when I am using hard code date , its working fine and when I am using current_date instead of hard code date. it is giving error. It also give error ststing "unable to find query information Top 3 customers'" I am using rank func also to display top n customers.
I am using excel as a datasource.
Thanks