SSAS 2012 - MDX Scope statement won't build

Question

Myloud on Wed, 08 May 2013 15:32:43


Dear gurus,

I am struggling with SSAS as this is the first time I play around with the SCOPE statement.

I am trying to build the following:



But I get:

Error 6 MdxScript(CUBE LNL DM) (9, 5) Parser: The syntax for 'THIS' is incorrect. 0 0

I tried putting the statement in a separate script but I get the same error. I do not understand as all examples of scope on the internet use that structure.

PS: I tried also with:

CALCULATE ;

SCOPE([Measures].[Sales Amount]);
    THIS = 1;
END SCOPE;
And I get Error 6 MdxScript(CUBE LNL DM) (12, 1) Parser: The syntax for ';' is incorrect. 0 0

I am unable to understand the issue

Any help is appreciated and thank you so much

Miloud Bel.






Replies

Elvis Long on Fri, 10 May 2013 06:54:49


Hi Miloud,

Please switch to "Script View" model, and then use the following MDX script:
Calculate;

SCOPE([Measures].[Sales Amount]);
    this=1;
END SCOPE;

For more information about SCOPE Statement (MDX), please see:
http://technet.microsoft.com/en-us/library/ms145989.aspx

Regards,

Myloud on Mon, 13 May 2013 07:10:36



thanks for your return ! I got it now !!


Miloud Bel.