Forum Discussion

ChrisR1ch's avatar
ChrisR1ch
New Contributor III
16 days ago

Member Filter on Scenario properties

I would like to apply a member filter on a scenario, which will return a list of a scenarios based on it's properties like Name, Description, WorkflowTime, WorkflowStartTime, and WorkflowEndTime...i....
  • ChrisR1ch's avatar
    ChrisR1ch
    16 days ago

    Just thought I would add what I did to resolve this issue.

    I created a parameter, of type Member List
    I set the Display Items and Value Items (comma delimited) as a call to an XBFR rule: XFBR(XFBR_Member_List, SP_Source_Scenario_List,PoVTime=|WFTime|)
    I set my Combo Box, Bound Parameter to the previously created parameter

    In my XFBR rule I return the list like this...

    Dim POVWorkflowTime As String = args.NameValuePairs.XFGetValue("PoVTime")
    Dim memberFilter As String = "S#SpendPlanControl.Base.Where(Name DoesNotContain Working)"
    Dim ScenarioLists As List (Of MemberInfo) = BRApi.Finance.Metadata.GetMembersUsingFilter(si, "S_BudEx", memberFilter, True)
    Dim memberString As String = String.Empty
    
    For Each scenarioMbr In ScenarioLists	
    	Dim ScenarioMember As MemberInfo = BRApi.Finance.Metadata.GetMember(si, DimType.Scenario.Id, scenarioMbr.Member.Name, True)
    	Dim ScenarioMemberID As Integer = ScenarioMember.Member.MemberId
    	
    	'Get Scenario member property WorkflowTime for comparison
    	Dim scenarioListWorkflowTime As String = ScenarioMember.GetScenarioProperties.WorkflowTime.GetStoredValue.ToString.Substring(0, 4)
    	Dim scenarioListWorkflowStartTime As String = ScenarioMember.GetScenarioProperties.WorkflowStartTime.GetStoredValue.ToString.Substring(0, 4)
    	Dim scenarioListWorkflowEndTime As String = ScenarioMember.GetScenarioProperties.WorkflowEndTime.GetStoredValue.ToString.Substring(0, 4)
    
    	'Compare Scenario List Workflow time to POV Workflow Time
    	If  scenarioListWorkflowTime = POVWorkflowTime Then
    		memberString = memberString & scenarioMbr.Member.Name & ","
    	End If				
    Next 
    
    Return memberString