Custom calculation with all members of parameter

marcmagdaleno
New Contributor

Hello all,

I am building a planning application on which the end users interact via drop-downs for Entity and UD1 members, and click a "Save Inputs" button that saves input data and runs a custom calculation on the selected entity and UD1.

marcmagdaleno_4-1689255097858.png

This is done through a data management step that runs a business rule, and on which the selection of the UD1 and Entity impact the business rule to avoid recalculating all the application each time. There are 6 business rules, that respond to different functional models, activated by different "Save" buttons across the application.

I want to create a button or data management sequence that will run all the business rules (the 6 models) for all UD1 members of the 4 entities, as an admin task. I have created a Data Management sequence that runs the 6 steps consecutively, with its corresponding button, but have not been successful to modify the arguments or the Data Management parameters to perform the calculation for all members, as I cannot input "E#All" or "E#Top.Base" on either side.

What would be the way to fulfill this sort of requirement with the button? And if the only way would be through the business rule and including a "For" loop for all base members, how would it be best practice to write it?

Current configuration, where UD1 and Entity are read:

On the button:

marcmagdaleno_1-1689254406217.png

On the Data Management Steps (Using one of the 6 as an example):

marcmagdaleno_2-1689254458265.pngmarcmagdaleno_3-1689254475855.png

On the business rule:

 

 

Dim ProfitCentre As String = args.CustomCalculateArgs.NameValuePairs("UD1")
.
.
.
api.data.calculate($"A#[Sample account]:UD1#{ProfitCentre}:{OtherDim}=......

 

 

 

Thank you very much for the support. Please let me know if any clarification is needed to come to a solution.

1 REPLY 1

Omkareshwar
Contributor II

Hi there,

To address your problem, let's first understand how a Data Management (DM) step works for a custom calculation. A DM step processes data units in parallel. You pass information about the destination data unit on the left-hand side of the equation, so you cannot enter a data unit on the left-hand side without causing an error as those are read from the DM step itself. However, on the right-hand side, you can specify the source data units from which you want to pull data.

If you want to process all 4 entities from a single DM step, you can use "E#Parentof4EntitiesYouWantToCalculate.base" notation. This will enable you to include all the desired entities in a single step.

In the screenshot you shared, the time filter mentions "T#|WFYear|.base." This creates 12 separate steps, one for each month, and processes them Sequentially. Similarly, if you apply the same concept to entities, it will create six different DM steps, one for each entity, and process them in parallel. This only applies to data units not for account level dimensions. 

For the "api.data.calculate" part, you can use filters to calculate for all UD1 members based on your filter for a single entity. The syntax would look like this:

api.Data.Calculate("LHS = RHS",,,,,"YourUD1Filter",,,,,,,,,,)

Omkareshwar_0-1689268247365.png

This filter will calculate for all UD1 members according to your specified filter for a single entity.

Please note that while this approach is simple and suitable for smaller calculations, it may not be the best practice for larger and more complex scenarios. In such cases, you might consider using databuffers to improve efficiency, but explaining that process here would be quite complex.

I hope this explanation helps. If you have any further questions or need additional assistance, please feel free to ask.

Thanks, Omkareshwar

Archetype Consulting 

Thanks, Omkareshwar
Archetype Consulting