cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with dynamic multi value @prompt and case (IDT 4.x)

Former Member

Hello, 1st timer here and need some help please.

Im trying to create a dynamic prompt that will automatically select a list of values from a LOV depending on the month of the current date. For example if the month number = 9 then the prompt will preselect the values 1,2. If the month number is 10 then the prompt will pre-select the values 1,2,3
My LOV (VPERIODS) will already list the correct number of values based on the month number.
This is my code

DimDate.PERIOD IN case when @Prompt('Enter Period','N','VPERIODS',Multi,Constrained,Persistent,{'99'}) = '99' then  [RETURN A LIST A VALUES] ELSE @Prompt('Enter Period','N','VPERIODS',Multi,Constrained,Persistent,{'99'}) END 

The error I get is incorrect syntax near keyword 'case'

If I change the prompt to MONO and use '=' instead of IN then it works fine but I can only set 1 value - but I need to prompt to pre-select a list of values.
Is this possible, can somebody please explain how this can be achieved if possible.
Another method I tried was this:

DimDate.PERIOD = CASE WHEN {fn month(convert (SMALLDATETIME, {fn CURDATE()}))} = 9 then @Prompt('Enter Period','N','VPERIODS',Multi,Constrained,{'1','2','3'}) WHEN {fn month(convert (SMALLDATETIME, {fn CURDATE()}))} = 10 then @Prompt('Enter Period','N','VPERIODS',Multi,Constrained,{'1','2','3','4'}) END 

but this also does not work

many thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Any suggestions?