Using variables in Calc scripts and Business Rules

I am sure there have been previous discussions about this, but can somebody let me know the benefits of using variables in Calc scripts and BRs?
Thanks,
A

I have never used calc variables and after reading a study guide, which talked about them, I couldn't really understand the benefits.^^^I use variables all the time to make abstract difficult formulas. Below is an example.
/*     Declare variables     */
VAR varSalaryCosts ;
VAR varProdOHLabXXXX ;
VAR varXXXX ;
A whole bunch of code here along with very limited FIX statement and then...
"Salaried Labor"
     varSalaryCosts = "Salary Costs"->"No Department"->"No Category"->"Salaried" -
                         "Wage Bonus"->"No Department"->"No Category"->"Salaried" -
                         "YYYY Retention Bonus 40%"->"No Department"->"No Category"->"Salaried" -
                         "YYYY 60% Ret Bonus Accrual"->"No Department"->"No Category"->"Salaried" ;
     varProdOHLabXXXX = "Number of Employees"->"ZZZZDepartments"->"Codes"->"Salaried" +
                         "Number of Employees"->"Blah Departments"->"Codes"->"Salaried" +
                         "Number of Employees"->"Humph Departments"->"Codes"->"Salaried" +
                         "Number of Employees"->"TTTT"->"Codes"->"Salaried" ;
     "Salaried Labor" = varSalaryCosts * ("Number of Employees"->"Salaried" / varProdOHLabXXXX) ;
)The last formula is how the formula was described to me by the business owner. I find it to be much easier to read than something like:
"Salaried Labor" = ("Salary Costs"->"No Department"->"No Category"->"Salaried" -
                         "Wage Bonus"->"No Department"->"No Category"->"Salaried" -
                         "YYYY Retention Bonus 40%"->"No Department"->"No Category"->"Salaried" -
                         "YYYY 60% Ret Bonus Accrual"->"No Department"->"No Category"->"Salaried") *
                         ("Number of Employees"->"Salaried" /
                         ("Number of Employees"->"ZZZZDepartments"->"Codes"->"Salaried" +           
                         "Number of Employees"->"Blah Departments"->"Codes"->"Salaried" +
                         "Number of Employees"->"Humph Departments"->"Codes"->"Salaried" +     
                         "Number of Employees"->"TTTT"->"Codes"->"Salaried")) ;I have used ARRAY in a really-cool-but-alas-not-invented-by-me calc script to do currency conversion in Planning better than Planning does currency conversion. (How's that for a run-on sentence?) It is one of the six blog posts I am working on and I will finish it soon, I hope. I am sort of in thrash mode right now. It does have its uses and I'll try to remember to update this thread when I'm done.
Regards,
Cameron Lackpour

Similar Messages

  • Run calc script via business rule

    Hello all,
    I have calc scripts and business rules in my hyperion essbase.
    one of the calc scripts e.g. aggregates some values.
    In the business rule i copied the code from the calc script and this business rule can be executed in the planning tool.
    Now, everytime when i change the code from the calc script, i have to change same things at the business rule.
    And now my question:
    Is it possible to start a calc script with the business rule?
    e.g. content of business rule: execute "calc_aggregate"
    Is there a command?
    Then it would save time and i only have to change the calc script and not both.
    Thanks for your efforts,
    Chris

    1) try to use essbase 9.3 with dataexport command in calc script (this version essbase is compatible with planning versions 9x and 4.1)
    2) you can write (or found in google) UDF function for run system command or (and) export data set
    3) you can run system command from Planning web and run CSC and RUL from essmsh
    ER

  • Calc another calc script from a calc script or business rule

    is there a way to call a common calc script segment from other calc scripts or business rules. I do not want to replicate common code in multiple business rules. This common code updates the Essbase database, so it would need to take Essbase members as parameters and be able issue calculation commands. I do not find this possible with custom macros or custom functions. Thanks - Davis ([email protected])

    I do not think you can call another calc script from within a calc script. An alternative would be to write a MaxL script that strings multiple calc scripts together.Good luck.

  • Unable to execute the substitution variable in calc scripts in essbase 11.1

    Unable to execute the substitution variable in calc scripts in essbase 11.1.3
    FIX(&CURRVERSION,COLA)
    Unit=units*Listprice;
    dataexport "file" "," "E:\NEW.TXT";
    ENDFIX
    Error: 1200471 Error parsing formula for FIX STATEMENT (line 1): expression expected before [)]
    This is error it throws when executing the calculation script
    I wonder whether its a problem with substitution variable i want to know wat went wrong inside the fix statement
    I have created substitution variable use maxl
    Installed the essbase in custom manner and standlone mode nt register with the shared services ,
    Is this problem with the custom installation of essbase
    Regards
    shenna

    If you remove the substitution variable and replace it with the actual value (whatever that is), does the code work? That will tell you if the issue is around the substitution variable or not.
    John -- First you race Glenn, then you race me -- and you always win. :)
    Regards,
    Cameron Lackpour

  • Search for member name in WebForms and Business Rules - 11.1.2.1

    Hi,
    Client has a hierarchy with two parents (Owned and Managed) within a dimension. The 'Managed' parent is no longer valid. Thus they want to eliminate it and move it's children under the 'Owned' member. However there could be ramifications in Business Rules and/or WebForms. Is there a way to search all Business Rules and WebForms for 'Managed' to see which Business Rules and/or WebForms would be affected?
    Or is best way to extract all the WebForms and Business Rules to xml files via LCM and then write custom script to search the files? Not sure if this functionality is already there or not.
    They are on 11.1.2.1

    I don't think "Show Usage" picks up Business Rules that are in the Calculation Manger.
    Also check the Member Formulas - easiest to do in the EAS (view the Outline, and the member formulas are displayed. Otherwise, in Planning, you would need to go into each member individually, and that would take forever). And if you're using Partitions or MRAs, you should check them, too.
    I'm assuming you're doing all of this in a copy of the application, and not on a "live" app, right? So you can make the change and then validate the Business Rules and Outline, and the error messages will tell you where "Managed" was being used.
    -Matt Varner

  • Currency Converion and Business Rule questions

    Hi all,
    I am new to BPC and would appreciate if you can help me answer few of my questions. I was going through how to documents on currency conversion and Business Rules.
    1. The Flow in Currency Conversion and Business Rules different?
    2. Can Currency conversion be done without defining the Currency Rules?
    3. In Business Rules Detail there is a cloumn for Sign. How should one determine what sign should go for a given account?
    Thanks,
    Diksha.

    Venkatesh,
    It seems like you are using Company as your Entity type dimension.
    Try to change your code to look like this
    *RUN_PROGRAM CURR_CONVERSION    
         CATEGORY = %CATEGORY_SET%     
         SELECT(%CURRENCY_SET_ID%,"[ID]",CURRENCY,"CURRENCY_TYPE='R'")
         TID_RA = %TIME_SET%
         RATEENTITY = GLOBAL
        OTHER = [COMPANY=%COMPANY_SET%] 
    *ENDRUN_PROGRAM

  • How to use Array in Calc script.

    Hi, <BR> I want to use Array in Calc scripts. Can anyone provide me some examples. <BR><BR>Thanks<BR>Murali

    For information on the ARRAY command, check out <a target=_blank class=ftalternatingbarlinklarge href="http://dev.hyperion.com/techdocs/essbase/essbase_712/Docs/techref/techref.htm">this hyperlink</a>.<BR><BR>Click on <b>Calculation Commands</b>, then choose <b>ARRAY</b>.<BR><BR>Can you give me some information explaining why you want to use ARRAY? It's use is pretty rare and I would like to understand what you're trying to do.

  • Business Logic and Business Rules

    Hi,
    I have a very basic question. If we develop a new screen on top of ECC using Webdynpro ABAP to replace a ECC default screen, say for an example, ME51n screen for purchase requisition to be replaced by a custom screen developed in ABAP Webdynpro, then how do we incorporate the inbuild business logic and the business rules of me51n in to this new screen developed in ABAP Webdynpro? In short, how do we incorporate business logic and rules in to ABAP Webdynpro application?
    do we have to code all the logic from scratch or we can use existing logic? If we can, how.
    Thank you for your help.
    Shai

    Duplicate thread
    Business Logic and Business Rules
    could you please close it.
    thanks
    sarbjeet singh

  • Using third party jars with Oracle Business Rules

    Hi
    I am working on Oracle AS 10g release 2.
    We are using Oracle Business Rules in integration with Oracle BPEL.
    While using third party jars however, Oracle Business Rules end is facing errors.
    Error during unmarshallingProvider com.sun.xml.bind.ContextFactory_1_0_1 not found
    oracle.classloader.util.AnnotatedClassNotFoundException:
    Missing class: com.sun.xml.bind.ContextFactory_1_0_1
    Dependent class: javax.xml.bind.ContextFinder
    Loader: oracle.xml:10.1.0_2
    Code-Source: /D:/oracleasr3/lib/xml.jar
    Configuration: <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in D:\oracleasr3\j2ee\home\oc4j.jar
    Can anybody help in figuring out where Jaxb jars(3rd party jars) are to be kept so that OAS access it?
    We tried using the applib folder to load the jars but we are getting class loading errors.
    When new instances are created, class loading is not happening.
    Pls help.
    Thanks
    Kavya

    Are you using Application Server Release 3 or Release 2? There are different versions listed in your mail.
    I think you probably want to add this as a shared library via EM and then import the shared library to your application with the application's xml config files.

  • When a sequence is created in planning and business rules added to it, can

    When a sequence is created in planning and business rules added to it, can be seen in planning and on task lists. However when further rules added, the sequence disappears from planning and from task list and can no longer be seen

    The security on each business rule will affect whether the sequence is visible - the underlying rules determine whether you see the sequence. If just one is not right the sequence will not be visible. Check the security - or add the rules to a project and assign project level security...
    Nick
    Edited by: Nicholas King on May 24, 2011 4:39 AM

  • User provisioning  Calc Scripts and Filters overlapping

    User Provisioning.
    Calc Scripts and Filters.
    When assigning filters, it works great, sets the right user roles to read and/or write on different members of a base.
    But then, "calc" rights override the Filters settings, allowing the user to write on the entire members and childs of the DataBase.
    Is there any way to assign Calc Scripts and widen the user rights through filters or some other way to prevent writting access to the entire members?
    Regards.
    Running on:
    Windows 2003 R2 x64.
    Essb 9.3.0.0.0
    Running on:
    Windows 2003 R2.
    SharedServices 9.3.0.0.0 WebLogic Express Based.

    Hi and thank you very much for your answer.
    I have, exactly 9.3.0.0 both, Essbase (now Analytic Server) and Shared Services, and yes, you're right about your comment, but the problem is I don't manage the security from EssBase I do it from SharedServices, because the EssBase users was "Externalized" and now all the security settings are managed with SharedServices.
    A coworker said me the same you did, but I think we can't do that any more because the security externalization.
    I really apreciate your help and time.
    Thanks
    Adrian

  • Calc script, Business rule and business rule macro

    Hi John,
    Can we use calc script , BR sequence and a BR macro against different databases at a single go.
    In one calc script or BR sequence or BR macro itself can i calculate 2 databases

    If possible could you not start every post with my name, there are lots of others helping on this forum and they provide excellent answers
    Calc Scripts run against one database.
    Sequences can contain multiple business rules, in the launch variables you can set the database to run against for each rule (outside of the planning application though)
    Macros are called from a business rule and are run against the database the calling rule is being run against.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Using a local Array in a Business Rule

    Newbie question here...
    I am writing a business rule that applies a standard rate to a lot of different lines in a business rule. This rate only varies by year, so from a logical perspective I think of it as a 1 dimensional variable. However the rate is actually stored in my normal Essbase cube (8-dimensions) something like the following:
    Dimension Dimension Member
    Account: Rate
    Dim2: No Dim2 Value (A dimension member called "No dim2 Value")
    Dim3: No Dim 3 Value
    Dim4: No Dim4 Value
    Dim5: No Dim5 Value
    Dim6: No Dim6 Value
    Dim7: No Dim7 Value
    Year: [varies by year]
    So right now my formula to calculate things looks something like the following:
    "Target Account 1" = "Driver Account 1" * Rate ->
    "No Dim2 Value" ->
    "No Dim3 Value" ->
    "No Dim3 Value" ->
    "No Dim5 Value" ->
    "No Dim6 Value" ->
    "No Dim7 Value"
    But I have to do this for several "Target" and "Driver" Accounts in the rule, which means an ugly looking rule. What I would like to do is create a local array at the beginning of my business rule and populate it with the rate:
    ARRAY _rate[Year]
    and then set the value of the array equal to
    Rate -> "No Dim2 Value" -> "No Dim3 Value" -> "No Dim3 Value" ->
    "No Dim5 Value" -> "No Dim6 Value" -> "No Dim7 Value"
    This will allow me to simplify my formula down to
    "Target Account 1" = "Driver Account 1" * _rate
    My first question is "can I do this?" I've been able to create an array and use it in the formula, but I can't figure out how to populate the values in the array from my main Essbase cube.
    The second question is "does it make sense to do this?" In addition to making the code easier to read, my guess is that populating the array once and just using it within the scope of the rule would be a bit more efficient than referencing that big cross dim expression, but I really don't know.
    Any advice anyone has would be appreciated.
    Thanks
    -Glenn

    I am familiar with what you are trying to accomplish.
    Having Essbase store a fixed rate over time to be used in calculations is possible. However formulas start to look complex depending on how many dimensions you have and what the desired outcome is.
    There are alternate techniques to the one you mentioned.
    You can create a new database for rates only and make it with fewer dimensions. Then use the @XREF function to retrieve it in your formulas.
    If the rate doesn't change very often you can put the Rate inside of the formula as is.
    For example Y2006_Rate = 5%.
    Brian Chow

  • Unable to Declare a Temporary Variable in Calc Script

    We are using Hyperion System 9 BI+ Analytic Administration Services. 9.2.03.0.44
    I am trying to declare a temporary variable in a calculation script.
    We have found several guides and examples in the support documentation that give us a step by step instruction on how to 1.) declare the variable, then 2.) Assign a value.
    Example:
    /* Declare the variable */
    VAR TotalAllocDept;
    /* Baseline Fix */
    FIX ("FY10","Jan","BU Version_1", "Actual", "NoProd", "NoCust")
    /* Assign a value to the variable */
    TotalAllocDept = ("Alloc_HR"+"Alloc_IT"+"Alloc_FIN");
    ENDFIX
    /* Allocate overhead based on Total Alloc Dept Variable */
    FIX ("FY10","Jan","BU Version_1", "Actual", "NoProd", "NoCust")
    "Alloc_5xSS" = @ALLOCATE("Alloc_Overhead","Account", TotalAllocDept,, share);
    ENDFIX
    However, when we try to check the syntax, we are given various error messages such as:
    Error parsing FIX STATEMENT "invalid object type" and
    "Invalid member name" and
    Invalid Calc Script syntax.
    Can anyone suggest some techniques that we can try or alternative ways of entering the text to make it possible for us to use temporary variables?

    A variable must be declared within a calc member block and can only exist for the scope of that block.
    This would work (not that you would necessarily want it)"
    /* Allocate overhead based on Total Alloc Dept Variable */
    FIX ("FY10","Jan","BU Version_1", "Actual", "NoProd", "NoCust")
    "Alloc_5xSS"
    TotalAllocDept = ("Alloc_HR""Alloc_IT""Alloc_FIN");
    "Alloc_5xSS" = @ALLOCATE("Alloc_Overhead","Account", TotalAllocDept,, share);
    ENDFIX
    Regards,
    Cameron Lackpour

  • Using Y-T-D values in Business Rules

    Hi All,
    I am using Hyperion Planning 11.1.1.1.0.
    I have enabled Y-T-D dynamic time series in the application.
    I need to calculate YTD variance% , the formula to be used is :
    (Y-T-D(Oct)Budget - Y-T-D(Oct) Actual) / Y-T-D(Oct)Budget * 100.
    I have a business rule(created in EAS) that does the other variance % calculations which are pretty simple like Budget-Actual/Budget*100.
    The formuls for the normal variance Percentage works but i get an error when writing a formula for :
    "Variance%(YTDActual&YTDBudget)"
    ("Variance%(YTDActual&YTDBudget)"="Y-T-D(&CurrentMonth)"->Budget - "Y-T-D(&CurrentMonth)"->Actual / "Y-T-D(&CurrentMonth)"->Budget *100;)
    The error that comes up is as follows:
    Detail:Cannot calculate. Analytic Server Error(1200497): Error compiling formula for [Variance%(YTDActual&YTDBudget)] (line 2): unknown member name ["Y-T-D(&CurrentMonth)"] in function [operator @X]
    Can somebody please advice as how to use Y-T-D values in the formulas?
    Kind Regards.
    Mirka

    Here are a couple of tips that may help:
    1) You cannot directly reference dynamic-time-series members in a business rule or a member formula. These are "virtual" members. This is a common misconception.
    2) Even if you could reference these members in a formula, you couldn't store a value in them anyway, as they are dynamic.
    3) It usually doesn't make a lot of sense to calculate variances like these in a business rule. I would recommend making them dynamic, two-pass member formulas (not business rules) in your Scenario dimension. They don't need to be "Two pass" in the typical sense (eg. recalculating a ratio at the quarters), but they need to fire last, so set them as two pass. (otherwise you will end up with order of calculation issues where other calculations fire after the variance and you get incorrect results).
    In looking at your requirement, you don't really need a variance that calls out dynamic time series members. Simply create a variance scenario with a formula like @VARPER("Budget", "Actual");. If you have "Y-T-D(Oct)" selected as your time period in your form or spreadsheet, and "Bud vs Act %" (this is your new variance scenario) selected, it will calculate the YTD variance for October, or whatever time period you have selected.
    Just to recap:
    1) Create a new scenario called "Bud vs Act %". Make it dynamic and two-pass. Give it a formula of @VARPER("Budget", "Actual");
    2) Scrap your business rule. Add other variance scenarios as needed.
    3) Add your YTD member and your variance scenario to a form, and test.
    Hope this helps,
    - Jake

Maybe you are looking for