Forum Discussion

LaurenHouzet's avatar
LaurenHouzet
New Contributor
6 months ago

How to create a formula that's specific to the base entities of a Parent

Hi OneStream Community - I'm trying to create a rule to apply a specific % to the base entities of a specific region. To keep it simple, say we have 5 regions and I want to create an account that tak...
  • T_Kress's avatar
    6 months ago

    You can use this api call to test (IF) whether the current entity being calculated is (descendantmemberid) a descendant of a particular region (ancenstormemberID), and if so continue with your calc or set the % base on a case statement by region:

    Dim bValue As Boolean = api.Members.IsDescendant(dimPk, ancestorMemberId, descendantMemberId, dimDisplayOptions)

     

  • FredLucas's avatar
    6 months ago

    Hi LaurenHouzet,

    Depending on the use case you might want to set it up as a dynamic calc or a stored account.

    If you are calculating it dynamically or as part of you consolidation logic then you might want to use the following function to validate if the Entity being calculated is a base member of the specific parent Entity / Region:

    Dim bValue As Boolean = api.Members.IsBase(dimPk, ancestorMemberId, baseMemberId)

    If calculating it as  part of a Finance Rule you could set up a DM Step that only triggers the calculation for the relevant entities: E#SpecificRegion.base