Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SSAS 2005 - MDX - stuck with SCOPE

Status
Not open for further replies.

MrPeds

Programmer
Jan 7, 2003
219
GB
Hi,

I have a SCOPE definition in a measure script which looks like this:

SCOPE([Location].[Location Idty].[All Location],Measures.[Iowa Sales Per Hr],[Units].[Units].[Actual]);

....
....
END SCOPE;

What this is saying is that if we are at the All Location level in the Location dimension, and at the Actual level then calculate this value.

I want to be able to change this slightly so that the scope statement calculates at any level except the All location level. Or put another way, calculate a value if the level <> All Location.

I have tried doing this:

SCOPE(DESCENDANTS([Location].[Location Idty].[All Location]),Measures.[Iowa Sales Per Hr],[Units].[Units].[Actual]);

but i get an error saying that the END SCOPE statement does not match the opening scope statement.

Have I simply left out a bracket or something or is there something else I need to look at?

thanks

MrPeds
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top