If you are unable to create a new account, please email support@bspsoftware.com

 

cognos parameters in data item as a case statement is required prompt macro

Started by maxchuie, 02 Feb 2017 12:35:57 PM

Previous topic - Next topic

maxchuie

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

rockytopmark

#
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]

maxchuie