API for calling a parameter

Mustafa_A
Contributor II

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: 

Mustafa_A_0-1638907022596.png


Let me if I can answer any questions.

 

Thanks for the help.

 

1 REPLY 1

ChristianW
Valued Contributor

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?