OSAdmin
4 years agoValued Contributor
Rule to Pick Scenario based on comparison between POV time and Time set for column in cubeview
Originally posted by Thomas Regehr
Hello,
We have a report that needs to transition between the Budget scenario and Actual scenario as we move through the year. Ideally the user will select a period, and depending if the period in the displayed column is current or in the past it will show Actual, else it will show Budget. I was asked to complete this without creating a new scenario.
I tried the below, but didn't have any success.
Public Function PastBudgetCurrFutActual(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As DashboardStringFunctionArgs) As String
Try
Dim currTime = args.NameValuePairs.XFGetValue("CurrentTime")
Dim timeId As Integer = BRApi.Finance.Members.GetMemberId(si, DimTypeId.Time, currTime)
Dim colTime = args.NameValuePairs.XFGetValue("ColTime")
Dim timeId2 As Integer = BRApi.Finance.Members.GetMemberId(si, DimTypeId.Time, colTime)
If timeId >= TimeId2
Return "S#Actual"
Else
Return "S#Budget"
End If
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Function
Any assistance would be appreciated. Thanks.