COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: tosty on 28 Nov 2006 02:45:40 AM

Title: [RS8] Dynamic Field change
Post by: tosty on 28 Nov 2006 02:45:40 AM
Hi all,

I would like to assign to a column in a Crosstab a dimension depending in the values choosen in a prompt.

My source is a PowerCube and what I would like to do is to have a column depending on the user selection on a prompt.

For example I have a Date Dimension with an Alternte path that includes comparrisions between the first 3 month of the actual year and the prevoius year and the same for the first 6 months and for the first 9 months. So what I want to do is to creat a kind of "variable column" that will have differents columns depending on the selection.

Any Ideas in this matterÃ,  Ã, ;D.


thanks...
Title: Re: [RS8] Dynamic Field change
Post by: sir_jeroen on 28 Nov 2006 12:46:58 PM
Ok... I'll make a suggestion:

add a calculation
Name : Dynamic_Column
Expression: #prompt('Selected_Column','token','[namespace].[querysubject].[queryitem]')#

Create a valueprompt on the prompt page.
as parameter use: Selected_Column

Add the following static values:
Use: [namespace].[querysubject].[queryitem]
Display: This_is_the_default_text

Add some extra values to your valueprompt also referencing to valid query items.


Explanation:
Replace [namespace].[querysubject].[queryitem] for a valid queryitem.
Now this expression will be passed to the C8 server. If nothing is chosen the server will use the default value as specified in the #prompt(...)# expression (default is [namespace].[querysubject].[queryitem] as you have specified in the expression).
If the selects something from the prompt that value (queryitem) will be used.
So now you have created a dynamic column without if... then .. else .. statements.


Title: Re: [RS8] Dynamic Field change
Post by: tosty on 29 Nov 2006 03:25:28 AM
 :o Wow.

Thank you very much ReportNet Addict.

It works at the first time.
Title: Re: [RS8] Dynamic Field change
Post by: sir_jeroen on 29 Nov 2006 08:53:00 AM
your welcome.. Plz close the topic...