The OneStream Community is temporarily frozen until June 29th due to the ongoing maintenance. Please read the blog post here to learn more.
Forum Discussion
MarkBird
2 years agoContributor III
Is it possible to pass a parameter to a UD8 dynamic calc member?
Hi all
I currently have a UD8 member to do a simple variance to actuals formula, but I was wondering if it is possible pass parameters to the UD8 member formula that this could be more dynamic?
My current code looks something like this:
Try
'Declare base and comparison scenario variables
Dim currentScenario As String = api.Pov.Scenario.Name
Dim comparativeScenario As String = "Actual"
'Define pov filters
Dim currentFilter As String = "S#" & currentScenario & ":U8#None"
Dim comparisonFiler As String = "S#" & comparativeScenario & ":U8#None"
Return api.Data.GetDataCell("BWDiff("& currentFilter & "," & comparisonFiler & ")")
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
However, I'm trying to see if there is a solution where I could have the following:
Dim comparativeScenario As String = |!Comparative_Scenario_Parameter!|
Thanks,
Mark
Hi Mark, not sure if it helps now, but i manage to pass a parameter using this:
Dim scen As String = BRApi.Dashboards.Parameters.GetLiteralParameterValue(si,False,Nothing,"Default.mbl_Scenario")
Cheers
4 Replies
- OmkareshwarContributor
Hi Mark,
You can read literal value parameters inside a dynamic calc.
I will suggest using Difference Between Columns in the Cube view itself rather than having a parameter inside a dynamic calc.
In the above example I am using Difference Between Columns CVC to get the difference between the scenarios. The Column names are self-explanatory you can setup your cube view like shown above. This approach is dynamic and works similarly just like a dynamic calc but will be easier to maintain. In your case you can replace Difference Between Columns CVC with Column Better/Worse CVC [GetDataCell(BWDiff(CVC(Col1), CVC(Col2))):Name(BetterWorse Difference)] rest everything will remain the same.
Thanks, Omkareshwar
Archetype Consulting
- MarkBirdContributor III
Hi Omkareshwar,
Thanks for the response.
Literal parameters won't work as I'm looking to try pass user prompt parameters to the UD8 calc.
And the reason I don't want to do the formula as a cube view formula, is because I use the result to generate status indicators like the ones below:
The indicator is determined using a business rule based on the outcome of the variance. I would like to have a single formula for both the variance column and the status indicator to ensure that they are always consistent.
The only way that would work is if I was able to pass the result of a cube view calc to a business rule, which I don't think is possible.
If the UD8 route isn't possible, then I'll just create a business rule instead.
Regards,
Mark
- julietaContributor
Hi Mark, not sure if it helps now, but i manage to pass a parameter using this:
Dim scen As String = BRApi.Dashboards.Parameters.GetLiteralParameterValue(si,False,Nothing,"Default.mbl_Scenario")
Cheers
Related Content
- 5 months ago