SSAS 2012 - MDX Scope statement won't build


  • 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:

    SCOPE([Measures].[Sales Amount]);
        THIS = 1;
    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.

    • Edited by Myloud Wednesday, May 08, 2013 3:34 PM addition
    Wednesday, May 08, 2013 3:32 PM


All replies

  • Hi Miloud,

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

    SCOPE([Measures].[Sales Amount]);

    For more information about SCOPE Statement (MDX), please see:


    Elvis Long
    TechNet Community Support

    • Marked as answer by Myloud Monday, May 13, 2013 7:41 AM
    Friday, May 10, 2013 6:54 AM

  • thanks for your return ! I got it now !!

    Miloud Bel.

    • Edited by Myloud Monday, May 13, 2013 7:41 AM fixed
    Monday, May 13, 2013 7:10 AM
  • Hi, guy! How you resolve the problem? I am looking for solution to this issue!
    Tuesday, April 19, 2016 9:43 AM
  • Hi Emily

    Use Elvis's answer, switch to script view and put your code, instead of putting it in the calculation designer it will work just fine when you switch back from script to designer view

    Tuesday, April 19, 2016 9:45 AM