Skip to main content
July 11, 2023
Solved

Is it possible to pass a parameter to a UD8 dynamic calc member?

  • July 11, 2023
  • 1 reply
  • 0 views

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

Best answer by julieta

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

 

1 reply

July 11, 2023

Hi Mark, 

You can read literal value parameters inside a dynamic calc.


Omkareshwar_0-1689079140066.png

I will suggest using Difference Between Columns in the Cube view itself rather than having a parameter inside a dynamic calc. 


Omkareshwar_0-1689086355959.png


Omkareshwar_1-1689086407985.png


Omkareshwar_2-1689086424554.png

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

 

 

 

 

MarkBirdAuthor
July 12, 2023

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:


MarkBird_0-1689147268573.png

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

julietaAnswer
February 5, 2025

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