using calculations in ssas cube


Please how can use this mdx script in the calculation part of a cube, will i simply dump it in the script form by starting with the 'create member current cube.[measures].[test]'

select 

[measures].[abc] on 0,

[xyz].[xyz].(&0):[xyz].[xyz].(&60) on 1

from

(

select

(tail([month].[month].[month].members,6))on 0

from

[cube])

thanks

May 21st, 2015 1:05am

Hi I4QR1A,

According to your description, you want to use the selected subcube into Calculations in cube. Right?

In this scenario, you need to use SCOPE() statement instead of using create member statement. You script should be like:

SCOPE(MEASURES.[abc]);
    SCOPE([xyz].[xyz].&[0]:[xyz].[xyz].&[60]);
        THIS = {[xyz].[xyz].&[0]:[xyz].[xyz].&[60]}
               *{tail([month].[month].[month].members,6)};
    END SCOPE;    
END SCOPE;

Reference:
SCOPE Statement (MDX)

Regards,

Free Windows Admin Tool Kit Click here and download it now
May 21st, 2015 1:10pm

And if you wanted to create this as a calculated measure rather than overwriting the [abc] measure you could do that with the following:

create member currentcube.measures.x as 
SUM( {[xyz].[xyz].&[0]:[xyz].[xyz].&[60]}
*{tail([month].[month].[month].members,6)}
, measures.[abc]);

May 24th, 2015 6:34am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics