How to use a parameter cube in PAW MDX
Posted: Thu Apr 17, 2025 11:12 pm
I have a calculated member in a PAW view. Instead of hardcoding the values in the calculation I would like to retrieve the element name from a parameter cube. I can't figure out the correct syntax.
This is the MDX with the hardcoded values:
I want the denominator of
to be retrieved from a cube. The cube will have the name of the scenario as a string data point.
I've tried this and I get ERROR in the cube (MDX compiles but I see the word ERROR in the data point):
I created a dynamic subset that returns the correct scenario using a rule-based attribute. Then I tried this:
That also results in an ERROR value.
How can I do this?
This is the MDX with the hardcoded values:
Code: Select all
WITH
MEMBER [Scenario].[Scenario].[Plan / Actuals] AS [Scenario].[Scenario].[Plan] / [Scenario].[Scenario].[Actuals], SOLVE_ORDER = 1, FORMAT_STRING = '#,##0.00;(#,##0.00)'
SELECT
{
[Period].[Period].[All Years^2020^2020Q2^202004]
} ON 0,
{
[Scenario].[Scenario].[Scenario Hierarchies^Actuals],
[Scenario].[Scenario].[Scenario Hierarchies^Plan],
[Scenario].[Scenario].[Plan / Actuals]
} ON 1
FROM
[Finance]
WHERE (
[Finance_Msr].[Finance_Msr].[Original],
[Company].[Company].[001],
[Department].[Department].[Total Departments^Sales and Marketing^40],
[Currency].[Currency].[USD],
[Account].[Account].[Net Income After Allocations^Net Income^EBITDA^Gross Margin^Net Sales^Sales^410000])
Code: Select all
MEMBER [Scenario].[Scenario].[Plan / Actuals] AS [Scenario].[Scenario].[Plan] / [Scenario].[Scenario].[Actuals]
I've tried this and I get ERROR in the cube (MDX compiles but I see the word ERROR in the data point):
Code: Select all
(
[Control].[Control Parameter].[Target Scenario],
[Controls].[Measure].[String]
)
Code: Select all
STRTOMEMBER("[Scenario].[Scenario].[" + SETTOSTR( TM1SubsetToSet([Scenario].[Scenario] , "TargetScenarioSubset" , "public")) + "]")
How can I do this?