09-29-2022 01:35 PM - last edited on 05-25-2023 07:45 AM by JackLacava
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
09-29-2022 02:39 PM
You will want to use something such as : Dim bValue As Boolean = api.Members.IsChild(dimPk, parentMemberId, childMemberId, dimDisplayOptions)
09-29-2022 03:08 PM
You can also use
If api.Pov.Scenario.Name = "Budget" Then
09-30-2022 03:50 AM
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)
09-30-2022 11:27 AM
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