COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: maxchuie on 02 Feb 2017 12:35:57 PM

Title: cognos parameters in data item as a case statement is required prompt macro
Post by: maxchuie on 02 Feb 2017 12:35:57 PM
cognos 10.2.2
ok new to prompt macros trying to figure this out

I have these 2 case statements as data items i am trying to figure out the prompt macro syntax just can get it .. HELP!!! plz

CASE WHEN ?Option? = 1 THEN [Rank Gross Profit] When ?Option? = 2 Then [Rank Revenue] end

CASE WHEN ?Option? = 1 and [Rank Gross Profit] < ?RARF? THEN [QryRank].[Gross profit] When ?Option? = 2 and [Rank Revenue] < ?RARF? Then [QryRank].[Revenue] end

attached is html

I tried this it did not work :
CASE  WHEN 1 then #prompt('Option','integer','[Rank Gross Profit]')#
When 2 then #prompt('Option','integer','[Rank Revenue]')#
end
Title: Re: cognos parameters in data item as a case statement is required prompt macro
Post by: rockytopmark on 06 Feb 2017 07:34:16 AM
#
CASE prompt('Option','integer')
WHEN 1 then '[Rank Gross Profit]'
When 2 then '[Rank Revenue]'
end
#

So, in this example, if Option param = 1, the data item would wind up [Rank Gross Profit]
Title: Re: cognos parameters in data item as a case statement is required prompt macro
Post by: maxchuie on 06 May 2017 04:55:35 PM
Thank you rockytopmark