Skip to main content
Newcomer
Dec 9, 2022 4:01 PM UTC

Using Global time Variable

Hello All,

I am trying to use the Global Time to pull reporting columns using the UD8 dimensionality but the values will not return.  

Dim ScenarioMth As String = api.Pov.Scenario.Name
Dim gbTimeName As String = BRApi.Workflow.General.GetGlobalTime(si)
Dim objTimeMemberSubComponents As TimeMemberSubComponents = BRApi.Finance.Time.GetSubComponentsFromName(si, gbTimeName)
Dim gbMonth As String = objTimeMemberSubComponents.Month.ToString

If gbMonth.Length < 2 Then
gbMonth = "0" & gbMonth
End If

Select Case gbMonth

Case 1
If ScenarioMth = "FCST" Then
Return api.Data.GetDataCell("U8#None")
Else
Return api.Data.GetDataCell("S#FCST12:U8#None")
End If

End Select

4 replies

Newcomer
Dec 9, 2022 4:13 PM UTC

Figured it out thank you all

Newcomer
Dec 12, 2022 2:50 PM UTC

Hi Dan, Can you post the information about the issue with the script and how'd you addressed?

Newcomer
Mar 27, 2023 4:21 PM UTC

Dim ScenarioMth As String = api.Pov.Scenario.Name
Dim gbTimeName As String = BRApi.Workflow.General.GetGlobalTime(si)
Dim objTimeMemberSubComponents As TimeMemberSubComponents = BRApi.Finance.Time.GetSubComponentsFromName(si, gbTimeName)
Dim gbMonth As String = objTimeMemberSubComponents.Month.ToString
'Dim gbMonthCur As Integer = gbMonth

If gbMonth.Length < 2 Then
gbMonth = "0" & gbMonth
End If

Select Case gbMonth

Case 11
'January
If ScenarioMth = "FCST12" Then
Return api.Data.GetDataCell("U8#None")
' Return "01"
Else
Return api.Data.GetDataCell("S#FCST01:U8#None")
' Return "02"
End If
Return "03"
End Select

Return gbMonth

Newcomer
Mar 27, 2023 4:22 PM UTC

Above is the values I wanted to return but went a different route.