locked
Dynamically change formula for Calculated Member RRS feed

  • Question

  • Hello Everyone,

    I have two calculated members on my time dimension and one calculated Measure. Currently my query is something like

    In my query I show the calculated measure on the row and the two calculated members on the columns.

    I want to apply a different formula for the calculated measure when it is evaluated against Member 1 and a different formula when it is evaluated against member 2.

    Is it possible to have a different formula for a calculated measure based on which member it is being evaluated against?
    Saturday, April 25, 2009 7:04 PM

Answers

  • You could use SCOPE in this case

     

    SCOPE([Measures].[Your Measure],[Dimension].[Hierarchy].[Member1]);
     
    THIS = Your Calculation 1;

    END SCOPE;


    SCOPE([Measures].[Your Measure],[Dimension].[Hierarchy].[Member2]);

    THIS = Your Calculation 2;

    END SCOPE;

    where,

     [Measures].[Your Measure] is your calculated measure
     [Dimension].[Hierarchy].[Member1] , [Dimension].[Hierarchy].[Member2] are your calculated members on the dimension.

     

    Saturday, April 25, 2009 8:59 PM
    Answerer