12-07-2021 03:01 PM - last edited on 05-19-2023 11:05 AM by JackLacava
Dear Community -
I'm building a dynamic prior year formula for my Variance Cube view. However I want to pull the MonthNo (e.g. M10) from the parameter I have |!SelectCol1Period!| so that it can reference the accurate period based on selected by user period. Currently it pulls the PY from POV instead of what the user has selected as his time period.
Wondering if their is an API function to call a parameter?
Here is the code I'm working with:
Dim SelectedTimeMonth As Integer = api.Time.GetPeriodNumFromId(api.pov.Time.MemberId)
Dim SelectedTimeYear As Integer = api.Time.GetYearFromId(api.Pov.Time.memberid)
Dim PYTime As String = (SelectedTimeYear - 1) & "M" & SelectedTimeMonth
Dim Amount As Decimal = api.Data.GetDataCell("U8#None:T#" & PYTime).CellAmount
Return Amount
Here is the front page of my cube view:
Let me if I can answer any questions.
Thanks for the help.
12-08-2021 05:17 AM
Sorry, as far as I know, there is no way to read a dynamic parameter from a member formula. You can read it from a literal parameter with BRApi.Dashboards.Parameters.GetLiteralParameterValue, but you can't use a control to change it, it will always return the default value.
About your sample, I don't think you need a member formula, why not just using U8#None:T#|CVYear||!SelectedTimeMonth!| in the cubeview?