Skip to main content
September 29, 2022

Scenario Business Rule

  • September 29, 2022
  • 3 replies
  • 0 views

Hi all! I need your help with a finance BR. I have a Budget scenario with different versions children members (ex: Budget, Budget_v1, Budget_V2, etc.) Right now my script goes like this: 

Dim isBudget As Boolean = api.Pov.Scenario.Name.XFContainsIgnoreCase("Budget")

If isBudget  Then

I am trying to find a script where I don't use "Contains", as if new scenarios are created in the future, the word "Budget" will always need to be apart of the member name, which is not ideal. Any suggestions how I can call the children members of Budget?

Thanks

3 replies

September 29, 2022

You will want to use something such as : Dim bValue As Boolean = api.Members.IsChild(dimPk, parentMemberId, childMemberId, dimDisplayOptions)

September 29, 2022

You can also use

If api.Pov.Scenario.Name = "Budget" Then

September 30, 2022

One might also use scenariotype if one wants to check for all Budget scenarios of that same type in case they are not all grouped under a parent.

Dim objScenarioType As ScenarioType = api.Scenario.GetScenarioType(scenarioId)

September 30, 2022

What Henning is saying makes sense. You can then follow up with the IF-THEN condition:

If objScenarioType = ScenarioType.Budget Then

      do stuff...

end if