BusinessObjects Board

Conditional prompts - help

I have a requirement when the user enters a flag = Y then two set of prompts should be considered and when the flag = N then another prompt should be considered.I am trying to create using case statement in the where clause.Is this the correct approach

if Flag = Y then
MGRID=@Prompt('Enter MGRID ',‘A’,‘My_Class\My_Object’, mono,free,persistent) and
ANLID=@Prompt('Enter ANLID ',‘A’,‘My_Class\My_Object’, mono,free,persistent)
or
If Flag=N then
ANAYLSTNAME = @Prompt('Enter AnalystName ',‘A’,‘My_Class\My_Object’, mono,free,persistent)

table.flag = case @Prompt('Enter Flag ',‘A’,‘My_Class\My_Object’, mono,free,persistent)
when Y then MGRID=@Prompt('Enter MGRID ',‘A’,‘My_Class\My_Object’, mono,free,persistent) and
ANLID=@Prompt('Enter ANLID ',‘A’,‘My_Class\My_Object’, mono,free,persistent)
when N then
ANAYLSTNAME = @Prompt('Enter AnalystName ',‘A’,‘My_Class\My_Object’, mono,free,persistent)
end

Thankyou


sparkling (BOB member since 2006-02-17)

You have to first keep in mind that prompts are independent of each other, in that they dont accept or read values from previous prompts (like in your requirement)

You can however simulate it by having three different prompts for MGRID, ANLID & ANAYLSTNAME created in the universe with the ‘ALL’ keyword. Check the syntax for ‘ALL’ here
Use “And” operator for all the prompt conditions while creating report query.

But note that you will have to train users to run the prompts by passing the values for MGRID & ANLID and keep ANAYLSTNAME prompt as ‘ALL’. Or pass values for ANAYLSTNAME prompt and keep MGRID & ANLID prompt as ‘ALL’

.


haider :es: (BOB member since 2005-07-18)