COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: CoolP on 16 Jul 2012 03:06:13 AM

Title: Re-run the same report with the next value of the prompt.
Post by: CoolP on 16 Jul 2012 03:06:13 AM
Hi,

Let's say there is a Product Line prompt with values A,B,C,D,E and the multi-select property is set to 'No'.
When the user selects 'B', the report will be rendered as expected.
However, On my report page, i should be provide NEXT,PREV (links/buttons/drill-through) which when clicked run the same report with the corresponding next/prev value.
So, when 'NEXT' is clicked, the report should run for 'C' and when 'PREV' is clicked, the report should run for value 'A'.

Solution without involving java script will be appreciated. For the time being, even java script would do.


Thanks
Prasan

Title: Re: Re-run the same report with the next value of the prompt.
Post by: Rahul Ganguli on 17 Jul 2012 03:41:34 AM
Hi,

This will require the following things
1. 2 Joins for getting current, previous, next values in the same query subject
2. sorting, so that the sequence never breaks

Your report will have 1 parameterized filter.
You have to create two singletons, one for previous and other for next. Define drill on these singletons.\

Hope this helps.

Regards,
Rahul
Title: Re: Re-run the same report with the next value of the prompt.
Post by: CoolP on 17 Jul 2012 11:49:28 PM
Yes, it did. But in my case, i didn't have any numeric column to compute the next and prev. So, I had to use running count function and used that in the prompt.

spec attached.


Thanks
Prasan
Title: Re: Re-run the same report with the next value of the prompt.
Post by: pricter on 18 Jul 2012 03:58:24 AM
If you still interested for a javacript solution you can try the following specification.

Title: Re: Re-run the same report with the next value of the prompt.
Post by: Rahul Ganguli on 18 Jul 2012 05:48:47 AM
Either set Sort Ascending on Pre-Sort Property of Productline dataitem used in all the queries.
or
Use Rank(Product Line) instead of running count.

You will have to create 3 base queries containing Product Line and rc,
Join the first two on rc=rc-1, you will get a join query
join the third query with previous step output query on rc=rc+1
Now in the final query you have 3 Product lines for previous, Current, and next.

Regards,
Rahul