Forum Discussion

Manju's avatar
Manju
New Contributor II
2 months ago

Re: Time always returns 0001-01-01 in BR when using XFBR in Cube View

i tried both |Time| and |POVTime| it didn't work

including XFBR function 

XFBR(BR_Name, FunctionName, SelectEntity = |Entity|, Time = |Time| ) 
Time = |POVTime| it didn't work.

BR,

Public Function BR_Name(  ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As DashboardStringFunctionArgs) As String

Try

Dim Entity As String = ""

If args.NameValuePairs.ContainsKey("SelectEntity") Then

Entity = args.NameValuePairs("SelectEntity")

Else

Return "" ' No entity → return nothing

End If

Dim POVTime As String = ""

Dim povYear As Integer = 0

If args.NameValuePairs.ContainsKey("Time") Then

POVTime = args.NameValuePairs("Time") ' e.g., "2025M12"

If POVTime <> "" Then

Try

povYear = CInt(Left(POVTime, 4))

Catch

povYear = 0

End Try

End If

End If

Dim ENTRemoveEntities_2026 As String() = {"Entity1","Entity2","Entity3"}

Dim EXITRemoveEntities_2026 As String() = {"Entity4","Entity5"}

Dim HistoricalENT As String() = {"Entity1","Entity2","Entity3"}

Dim HistoricalEXIT As String() = {"Entity4","Entity5""}

If povYear >= 2026 Then

If Entity = "Entity3" Then

Return "ENT" 

ElseIf ENTRemoveEntities_2026.Contains(Entity) Then

Return "" ' ENT removed

End If

 

' EXIT rules

If EXITRemoveEntities_2026.Contains(Entity) Then

Return "" ' EXIT removed

End If

 

' Default for 2026+ other entities

Return "ENT"

End If

 

If HistoricalENT.Contains(Entity) Then

Return "ENT"

End If

If HistoricalEXIT.Contains(Entity) Then

Return "EXIT"

End If

Return "ENT"

Catch ex As Exception

Return "ENT"

End Try

End Function

 

 

1 Reply

  • sameburn's avatar
    sameburn
    Icon for OneStream Employee rankOneStream Employee

    Do you have Time selected in your POV? If not, |POVTime| will not work

    Also I don't believe |Time| is valid as a substitution variable

    Have you tried logging the Time variable that gets passed into your code e.g before adding your logic; just to demystify what variable values are being passed into your logic?

    This works as expected for me