Skip to Content
Technical Articles

How to check condition in script logic

Let’s assume that user can select a single CATEGORY member in Data Manager prompt (for example. using PROMPT COMBOBOX DM PROMPT(COMBOBOX,…) behavior in BPC NW 10 and 7.5). You want to execute logic depending on CATEGORY member: some logic for ACTUAL, another logic for BUDGET.

User selection is in $CAT$ variable. The code will be:

*SELECT(%CIDSA%,[ID],CATEGORY,ID=$CAT$,ACTUAL AND CALC=N)
*SELECT(%CIDGEA%,[ID],CATEGORY,ID>=%CIDSA% AND CALC=N)
*SELECT(%CIDLEA%,[ID],CATEGORY,ID<=%CIDSA% AND CALC=N)
*SELECT(%CIDFIRSTA%,[ID],CATEGORY,ID>=%CIDLEA% AND ID<=%CIDSA% AND CALC=N)
*SELECT(%IFCACTUAL%,[ID],CATEGORY,ID<=%CIDGEA% AND ID>=%CIDSA% AND ID=%CIDFIRSTA% AND CALC=N) 

*SELECT(%CIDSF%,[ID],CATEGORY,ID=$CAT$,BUDGET AND CALC=N)
*SELECT(%CIDGEF%,[ID],CATEGORY,ID>=%CIDSF% AND CALC=N)
*SELECT(%CIDLEF%,[ID],CATEGORY,ID<=%CIDSF% AND CALC=N)
*SELECT(%CIDFIRSTF%,[ID],CATEGORY,ID>=%CIDLEF% AND ID<=%CIDSF% AND CALC=N)
*SELECT(%IFCBUDGET%,[ID],CATEGORY,ID<=%CIDGEF% AND ID>=%CIDSF% AND ID=%CIDFIRSTF% AND CALC=N) 

*FOR %CA%=%IFCACTUAL%
//Some logic for ACTUAL selection
*XDIM_MEMBERSET CATEGORY=%IFCACTUAL%
*NEXT

*FOR %CF%=%IFCBUDGET%
//Some logic for BUDGET selection
*XDIM_MEMBERSET CATEGORY=%IFCBUDGET%
*NEXT

Variable %IFCACTUAL% will be equal to ACTUAL if ACTUAL is selected in $CAT$ or empty if any other category member. Same for %IFCBUDGET%

 

Be the first to leave a comment
You must be Logged on to comment or reply to a post.