Skip to main content
Newcomer
December 9, 2022

Using Global time Variable

  • December 9, 2022
  • 4 replies
  • 0 views

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
December 9, 2022

Figured it out thank you all

Newcomer
December 12, 2022

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

Newcomer
March 27, 2023

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
March 27, 2023

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