Forum Discussion

DanTenneco's avatar
DanTenneco
New Contributor II
3 years ago

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

  • DanTenneco's avatar
    DanTenneco
    New Contributor II

    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

  • rxs_755's avatar
    rxs_755
    New Contributor

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

  • DanTenneco's avatar
    DanTenneco
    New Contributor II

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