COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Raghuvir on 25 Apr 2014 09:17:35 AM

Title: Dynamic Sorting
Post by: Raghuvir on 25 Apr 2014 09:17:35 AM
hi all,

i have prepared a report in which i have 2 prompts. one for choice and another for sorting type. in the choice prompt, user can select the measure on which sorting should be done for e.g. quantity and revenue whereas in the type prompt the user can select the type of sort i.e ascending and descending.

is this scenario for dynamic sorting possible ?

attaching the xml for the report.

Regards
Title: Re: Dynamic Sorting
Post by: MFGF on 25 Apr 2014 10:05:56 AM
Hi,

Yes. The solution is attached. The approach is to create a new calculation with an if-then-else that sets itself either to the Quantity value or the Revenue value depending on the selection in the first parameter. Then another calculation that uses an if-then-else to set itself to either this value or this value multiplied by -1 depending on the selection in the second parameter. You sort ascending on this value.

Cheers!

MF.

Title: Re: Dynamic Sorting
Post by: Raghuvir on 25 Apr 2014 10:25:38 AM
Hi MFGF,

Awesome...really thanks!
is there anything you cant do ? :P

Regards
Title: Re: Dynamic Sorting
Post by: MFGF on 25 Apr 2014 11:17:09 AM
Quote from: Raghuvir on 25 Apr 2014 10:25:38 AM
Hi MFGF,

Awesome...really thanks!
is there anything you cant do ? :P

Regards

Lots and lots of things! I discovered the other day that I'm not eligible to be President of the USA, because of some nonsense about me not being American by birth. That's ruined my plans for next year. I was going to travel over there and do a term or two. Sadly I can't though. ;)
Another thing I can't do, app...   ...arently is multitask. This coffee is...  ...nice though - I can't leave it alone! :)

MF.
Title: Re: Dynamic Sorting
Post by: bdbits on 25 Apr 2014 04:54:23 PM
Muppet for Prime Minister has a certain ring to it.  :D
Title: Re: Dynamic Sorting
Post by: MFGF on 26 Apr 2014 06:15:43 AM
Quote from: bdbits on 25 Apr 2014 04:54:23 PM
Muppet for Prime Minister has a certain ring to it.  :D

Ooh! yes! That's a worrying thought! It has a ring too? Is it a gold one with inscriptions on it? Can I get the ring without taking the job? ;)