Forum Discussion

AlvaroSR's avatar
AlvaroSR
New Contributor II
7 months ago

Get WFScenario in Complex Expression Time Data Source

I am trying out a complex expression in Time Data Source. The issue is the next: I have a Forecast scenario type with input frequency monthly and on the other hand I have a Long Term scenario type ...
  • AlvaroSR's avatar
    7 months ago

    Finally, I solved with the next script:

    Dim vYear As String = args.Value
    ''Dim scenId As Integer = api.ScenarioTypeID
    Dim scenId As Integer=api.CurrentDataClusterKey.ScenarioID
    Dim scenType As ScenarioType = BRApi.Finance.Scenario.GetScenarioType(si,scenId)
    ''brapi.ErrorLog.LogMessage(si,sValue)
    If (scenType.ToString = "LongTerm") Then
    Return vYear
    Else
    Return vYear + "M12"
    End If

     

    Maybe someone has the same issue,

    Thanks.