COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: dimi on 11 Sep 2006 03:49:18 AM

Title: Dynamically sort in a cube
Post by: dimi on 11 Sep 2006 03:49:18 AM
Hi
I want to set up a ReportStudio report where i can dynamically sort on choosen a field (via a prompt).
The Report is base on a dimensional datasource.
i already managed to set up the order by (with the MDX order function), but if i try to dynamically set this up it does not work.

for example 1:
order([Staff Name]; roleValue('_memberCaption', [Staff Name]); basc) -> this works
example 2:
order([Staff Place]; roleValue('_memberCaption', [Staff Place]); basc) -> this works to

But
for example:

Case ?Order_by?
When 1 then order([Staff Name]; roleValue('_memberCaption', [Staff Name]); basc)
When 2 then order([Staff Place]; roleValue('_memberCaption', [Staff Place]); basc)
END

-> this does not work

Anybody any ideas?
Thanks


Title: Re: Dynamically sort in a cube
Post by: dimi on 12 Oct 2006 08:17:02 AM
Problem solved!

I use somthing like this:

order([Staff Name]; #prompt('Sort_by','token')#;#prompt('Sort_order';''token')#)