COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: philelmousse on 13 Dec 2011 03:26:06 AM

Title: issue to sort data item based on prompt parameter
Post by: philelmousse on 13 Dec 2011 03:26:06 AM
Hello, I have a data item built like this :

#prompt('p_Time','token','[REPORTING LAYER].[Time].[Time]')#

My dimension Time has "Year","Month" and "Day" level. I would like to sort that data item with the business key of. I'm not able to do it... can you help please ?
Title: Re: issue to sort data item based on prompt parameter
Post by: CognosPaul on 13 Dec 2011 03:32:37 AM
Create and sort using a new data item:

roleValue('_businessKey',[Data Item])

With [Data Item] containing the prompt macro.
Title: Re: issue to sort data item based on prompt parameter
Post by: philelmousse on 16 Dec 2011 03:50:28 AM
My business key are char format so I created a MemberDescription with integer values. I used something like to sort the dataitem

roleValue('_memberDescription',[Data Item])

It doesnt work. When I try to display that data item it returns the member caption of the month. Do you have an idea ?
Title: Re: issue to sort data item based on prompt parameter
Post by: CognosPaul on 22 Dec 2011 01:27:52 AM
Right click on the member from the tree and click properties. the roleValue returns any of those strings. So if memberDescription doesn't appear there, you'd have to find a different solution.

Your prompt is returning the level? Does every level have Member Description? You might be able to get away with something like

order(#prompt('p_Time','token','[REPORTING LAYER].[Time].[Time]')# , #prompt('p_Time','token','[REPORTING LAYER].[Time].[Time]') + '.[Member Description]'#, asc)
Title: Re: issue to sort data item based on prompt parameter
Post by: philelmousse on 22 Dec 2011 06:16:08 AM
Thanks for your reply. I just faced the issue by sorting the dimension directly in framework manager by the member_description.