Scenario Business Rule

EmilieDurand
New Contributor II

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

4 REPLIES 4

EricOsmanski
Valued Contributor

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

Krishna
Valued Contributor

You can also use

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

Thanks
Krishna

Henning
Valued Contributor

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)

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