Hello Folks,
I am currently working on BO 6.5.1 and need some help with regards to creating a predefined condition by decoding certain values. The values should be grouped together to form a group. For Ex: the values 1,2,3,5 should be grouped together to be put into the parameter as ‘XXX’, while a single value 6 should be used as a prompt value called ‘YYY’. How would I write a @prompt statement to resolve this request.
The approach that I have followed here is by creating a dimension object which I am using as a LOV in the predefined condition with @prompt. When I enter ‘XXX’ or ‘YYY’ in the prompt, it would fetch no data. But, when I am entering the numeral value, it gets me the right data.
Here is a brief illustration of the objects that I have created:
Dim_obj - CASE WHEN table.column IN (‘1’,‘2’,‘3’,‘5’) THEN ‘XXX’
WHEN table.column IN (‘4’) THEN ‘YYY’ END
Predefined_Condition - table.column in @Prompt(‘Enter Type’,‘A’,‘Dim_obj’,MONO,free)
The difference is that in the first case, the prompt is compared directly to table.column while in the second case the prompt is compared to the definition of the dim_obj object from the class.
What @select() does is it takes the select part of the definition of an object (in this case the object is class\dim_obj) and place it where the function is used. So if ‘class\dim_obj’ is defined as
CASE WHEN table.column IN ('1','2','3','5') THEN 'XXX'
WHEN table.column IN ('4') THEN 'YYY'
END
Then this condition
@Select(class\dim_obj) in @Prompt('Enter Type','A','class\dim_obj',multi,free)
will be replaced by this code in the moment when BO will send the query to a database:
CASE WHEN table.column IN ('1','2','3','5') THEN 'XXX'
WHEN table.column IN ('4') THEN 'YYY'
END in @Prompt('Enter Type','A','class\dim_obj',multi,free)