Forum Discussion

Oscar's avatar
Oscar
Contributor
4 years ago

Aggregation Business Rule

Hello

How does one write an aggregation business rule? I know Accounts aggregate automatically, but a business  rule is needed for Entities, correct? In Essbase we could have something like:

 

FIX ("2025","Jan":"Dec","Actual")


Calc DIM ("Account","Source","Product","ResponsibilityCenter","Interco","Entity","Location");


ENDFIX;

4 Replies

  • EricOsmanski's avatar
    EricOsmanski
    Icon for OneStream Employee rankOneStream Employee

    Depending on what version you are on, Entity Aggregation is now in the platform and does not require any BR's.. You can read more n the Reference Guide :  

     

  • There are multiple ways. One is as Eric suggested.

    If you are on the latest version, you can use Aggregated Cons member to trigger an aggregation.

  • ChristianW's avatar
    ChristianW
    Icon for OneStream Employee rankOneStream Employee

    It doesn't work for entities, but I want to mention it anyway:

    The api.data.calculate function has filter parameters, they can be used similar to the fix command:

    api.Data.Calculate(formula, accountFilter, flowFilter, originFilter, icFilter, ud1Filter, ud2Filter, ud3Filter, ud4Filter, ud5Filter, ud6Filter, ud7Filter, ud8Filter, onEvalDataBuffer, userState, isDurableCalculatedData)
    
    api.Data.Calculate("A#Profit=A#Sales-A#COGS",,,,,"UD1#Admin.base",,"UD3#Americas.base, UD3#UK",,,,"UD7#Top.base.remove(None)",,,,)

     I hope this helps

  • Oscar,

    The most obvious way for the older versions of the OS is to run a databuffer for your E#ParentEntity.Base and do your simple math inside the loop. I know it's kind of simplistic solution, but hey, keep it simple 🙂