The syntax for 'Scope' is incorrect

  • Ive been trying for the last few hours to create a SIMPLE scope statement in SSAS, but whatever I do I get an error with a red squigly underline on the SCOPE statement and the 'syntax for scope is incorrect' error.

    As soon as I type the word scope SSAS throws it out with a red squiggly line, ive attached an image as an example. Other threads mention this problem but suggest the use of semi-colons to clear it up, it has no effect here.

    Does anyone have any ideas? Thankyou in advance.

  • Your syntax for the scoped assignment is incorrect.

    A scoped assignment sets the value of a calculated measure(s), but in itself is not a calculated measure. This means that you cannot start the scoped assignment with "CREATE MEMBER...".

    Create an empty calculated measure first ("CREATE MEMBER... AS NULL;") followed by the scoped assignment ("SCOPE (<calculated measure created in the first step>)...")

  • Martin,

    Thanks for the reply. Ive had another try and im still getting a red line under the word scope no matter what I do. Ive included another screenshot, am I way off the mark? Thanks.

  • The reason for the red line is because your Scope statement is incomplete. It should go away once you've added the rest of it.

  • Martin,

    That worked, thanks.

    Still don't know why theres a red squiggly line underneath Scope but oh well.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply