COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: Ravisha on 09 May 2021 09:25:32 PM

Title: Conditional Prompt Macros with multi-select LIKE wildcard
Post by: Ravisha on 09 May 2021 09:25:32 PM
Hi Cognoise,

I came across a requirement where based on the selection made in the 'Level' prompt either the [Column] has to be substringed ('Level' =  1) or if a user selects other than 'Level' = 1 then the choices/parameter values user has selected from the search & select prompt should be passed with a 'LIKE' wildcard that would mimic -->[Column] starts with 'parameter_value_1%' and [Column] starts with 'parameter_value_2%'

if (?Level? = 1)
then ( substring ([Column], 1, 6) in ?prompt_contract? )
else (        --- this where I believe the prompt macros would help if two or more parameter selection have been made from search and select prompt
             [Column] LIKE 'abc%'
       or [Column] LIKE 'xyz%'
       or [Column] LIKE 'qrs%'
        )

It would be nice if the expression above can be transformed into Prompt macros in its entirety. Your help on this would be greatly appreciated.