COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: S_N_Solution on 02 Dec 2009 04:02:01 AM

Title: Number of rows as per the Prompt value
Post by: S_N_Solution on 02 Dec 2009 04:02:01 AM
Hi,

I want to design a report having a text prompt and having a list report.Now whatever number i will give in the prompt that the same number of rows should come after running the report.

Please help me to get this logic in detail.


Thanks
Title: Re: Number of rows as per the Prompt value
Post by: Sarayucog on 02 Dec 2009 04:50:22 AM
Hi,

1. Just take whatever queryitems u want in the report. Productline, producttype and Revenue.

2. Go to Query Explorer bar --- click on Quries.

3. Take a Dataitem and write a condition as

rank (total ([Sales (query)].[Sales].[Revenue] for[Sales (query)].[Product].[Product type]))

4. Change the name of that dataitem as Rank and the drag and drop in Detail Filters and write expression as

         [Rank]=?pl?

5. Take a prompt page and drag and drop a prompt in prompt page and select the existing parameter radio button and select what the parameter u r getting there.

    Then run the report.


I think this answer will helps to you.
Title: Re: Number of rows as per the Prompt value
Post by: lindero on 02 Dec 2009 10:23:35 AM
Hi,

what if two different product types have the same total value? Then the rank data item looks like this

rank   | revenue
-------------------
22     | 1200
23     | 1100
23     | 1100
25     |   900


Maybe for this case it is better to create a data item with a constant of 1. Then you set an running-total function on this.

this is an option as well.

kind regards