3 Replies Latest reply: Apr 21, 2014 10:18 AM by Pedro Soares RSS

    Reutilization of Business Rules in Hyperion Planning

    Pedro Soares

      Hi,

       

      I have a business rules A that has the same script for 3form X, Y and Z, except in the dense dimensions it should only write in specific accounts that are form delimited (in rows). I was trying to find a way to reutilise the rule and pass the variable somehow based on the data form. Is that possible?

       

      Thank you

        • 1. Re: Reutilization of Business Rules in Hyperion Planning
          Alp Burak

          Hi,

          As you might have noticed already, business rule reads only page values as parameters. If I'm not mistaken, you want to calculate only certain accounts in either of these 3 forms using the same business rule. I can think of one way:

          Create a flag member in accounts dimension that will identify the form such as Form_Id

          Now Form_Id will signify the form name. If you set it to 1, it will mean Form X, 2 will mean Form Y and 3 will mean Form Z.

          Write three business rules to set a flag on save of the form. These should run before the main rule itself. It's a very simple rule:

          Rule: Form_ID_X

          FIX([one of the page members, I'd go with Entity] )

          [Block Member such as Budget](

          "Form_Id"->[Narrow it down to single dim combination]=1;

          )

          ENDFIX

          In your main calculation, you can check the value set to this flag and calculate only relevant part:

          FIX([Your fixed members])

          [Block Member such as Budget](

          if("Form_Id"->[the same combination you used above]==1)

          Account group 1 calculation;

          elseif("Form_Id"->[the same combination you used above]==2)

          Account group 2 calculation;

          etc...

          endif

          )

          ENDFIX

           

          Cheers,

          Alp

          • 2. Re: Reutilization of Business Rules in Hyperion Planning
            Pedro Soares

            Hi Alp,

             

            Thank you for your feedback.

             

            But then I would be replicating code on the if conditions and that would be the same, except I would be changing the accounts there.

             

            I actually found an elegant solution, or at least I was heading to it, until I find a way to restrict user variables values.

             

            I was thinking in using a user variable for the account dimension and on rows I would use @IDescendants(&uVarAccount). This way I could create a global variable in Calculation Manager that would read the user variable and that would delimit my rows context.

             

            The  problem I found is that I don't have any option to restrict the user variable values that the user can choose (I need to limit them to accounts on the natural account structure and only to on certain level, (ie. I only want user to choose accounts 22,23,24,25). If that worked it would be awesone. Not only 1 business rule but only 1 data form would be used

            • 3. Re: Reutilization of Business Rules in Hyperion Planning
              Pedro Soares

              Ok, so what I did was create a template with a design time prompt. Then create X rules to each X account that I was needing and call the template as followed:

               

               

              Rule 1 script: %Template(name:="tplBasicBudget",application:="HYP_GBM",plantype:="Plan1",dtps:=("dtpAccount":=([[@Relative("NA_22",0)]])))

              Rule 2 script: %Template(name:="tplBasicBudget",application:="HYP_GBM",plantype:="Plan1",dtps:=("dtpAccount":=([[@Relative("NA_23",0)]])))

               

              And so on.

               

              Not exactly what I wanted because I only wanted 1 Business Rule, but at least I only change the code on the template and keep it all centralized in 1 place.

               

              Thank you