COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: tequila on 19 Aug 2014 01:37:15 AM

Title: How to change the dataformat with static prompt?
Post by: tequila on 19 Aug 2014 01:37:15 AM
Hello,

i have 'static prompt' - with two calculation

e.g

if (?Abweichung?=1) then ((x)-(y))
else ((x)/(y))

also the static prompt:

1. with number in the dataformat (0 number of decimal)
2. with % (1 number of decimal)

How can I make the calculation or the dataformat that with the 'static prompt' one in number (2223) and other in % (10,1%) in the dataformat?

thnx all


Title: Re: How to change the dataformat with static prompt?
Post by: BigChris on 19 Aug 2014 05:59:18 AM
Create two fields in your report. Column A contains x-y. Column B contains x/y. Format the two fields to be the way you want them. Create a render variable that will display one field or the other depending on what you select from your static prompt.
Title: Re: How to change the dataformat with static prompt?
Post by: Lynn on 19 Aug 2014 07:56:31 AM
You can use one data item for your calculation and then apply an advanced conditional style to show either data format depending on the prompt response.

Click on your calculated field in the layout and then select the Conditional Styles property. Create a new advanced conditional style with two conditions. One condition will have the expression:

ParamValue(Abweichung) = 1

and the other will have the expression:

ParamValue(Abweichung) <> 1

Click on the pencil in the style area for each and specify the data format as appropriate.