Discussions
Categories
- 17.9K All Categories
- 3.4K Industry Applications
- 3.3K Intelligent Advisor
- 62 Insurance
- 536.1K On-Premises Infrastructure
- 138.2K Analytics Software
- 38.6K Application Development Software
- 5.7K Cloud Platform
- 109.4K Database Software
- 17.5K Enterprise Manager
- 8.8K Hardware
- 71.1K Infrastructure Software
- 105.2K Integration
- 41.6K Security Software
IF without members

Is it possible to have IF without members in PBCS business rules?
i.e. I would like some of my scripts sections to not execute when an external variable is set.
But trying the below, before introducing the variable, I get an error....
IF ( 1=2)
fix (&currforc, &curryear, working, local, basedata )
agg("division", "cost Centre", "Entity", "Employee");
endfix
ELSE
fix (&currforc, &curryear, working, local, basedata )
agg("division");
endfix
endif;
A validation error was received from the Planning server.
'Error:The CALC command [IF] can only be used within a CALC Member Block Rule CCplan.Wrkforce.Sysadmin Script'
n.b. The above is not what I want to do, just a first test of if I could get IF to work in this way to give me logic that I can apply outside of the Essbase cube?
Preferably I do not want a hybrid fudge of (say) adding my external variable to a value in essbase and then testing on that value.
Best Answer
-
Hello,
Per my understanding, you want to use a variable to decide whether or not to execute a business rule. Is that correct?
Did you try using prompts (RTP or DTP) for external variable ?
FIX cannot be used within IF. Rather it's the other way round.
If you don't want to execute the FIX statement based on some condition, you could check the SET commands.
You can check these links:
http://essbasedownunder.com/2016/11/conditional-fix-statements/
https://docs.oracle.com/cd/E40248_01/epm.1112/essbase_tech_ref/frameset.htm?set_runtimesubvars.html
(which i assume you would already have).
Still my two cents.
Thanks,
Pawan.
Answers
-
Hello,
"IF command" only can use inside calc member block.
for example:
FIX (members)
Account(
IF(Account==1)
your code
ELSE
your code
ENDIF
)
ENDFIX
You can't use FIX command inside IF command.
Regards
-
Is there any alternative means then to introduce the equivalent of procedural logic into a business rule, such that based on an external parameter, numeric, text, whatever, you can have blocks of your code NOT execute based on a value that is passed in via a variable?
-
If you want that your code not execute some parts of your cube you should to use FIX statement and filter that you want to calc.
-
This is more of the nature of a number of fixes that should not execute.
Could a loop be used with break to prevent execution of a large subset of a calc script?
-
Hello,
Per my understanding, you want to use a variable to decide whether or not to execute a business rule. Is that correct?
Did you try using prompts (RTP or DTP) for external variable ?
FIX cannot be used within IF. Rather it's the other way round.
If you don't want to execute the FIX statement based on some condition, you could check the SET commands.
You can check these links:
http://essbasedownunder.com/2016/11/conditional-fix-statements/
https://docs.oracle.com/cd/E40248_01/epm.1112/essbase_tech_ref/frameset.htm?set_runtimesubvars.html
(which i assume you would already have).
Still my two cents.
Thanks,
Pawan.
-
Thanks,
I agree the logic on both is less than obvious.
Okay, it is not obvious at all.
But this is exactly what I was looking for, and parallel to my thoughts on loop...
Presumably I can set a subvar based on an external variable, passed in at runtime, or a substitution variable?
SET RUNTIMESUBVARS {
runForecast= &TimeToRunForecast;
runBudget=&TimeToRunBudget;
};AND
SET RUNTIMESUBVARS {
runForecast= {TimeToRunForecast};
runBudget= {TimeToRunBudget};
};Two cents very gladly received, points coming your way!
Thank you!
-
Using a calculation manager variable with RTP would allow you to specify a value when the rule is run (upon form save for example).
Using Essbase Substitution variable doesn't allow you to specify a value but would use the default value in Essbase.
Thanks,
Pawan.
-
Many thanks again, hope I can return the favour one day!