2

I'm building an SSAS OLAP cube on Meteorological data. Some of this data can be totaled (eg rainfall) and some can't (like wind direction).

I want totals, but only on data sources where it makes sense. (Where the interpolation method = 3.)

I've tried adding SCOPE with this:

SCOPE ([Measures].[Total]); 
SUM([Data Source].[Interpolation Method].&[3],[Measures].[Total]); 
END SCOPE; 

And get warnings:

Invalid query syntax. A valid MDX or DAX query was expected

and:

One or more errors were encountered in the MDX script

What am i missing?

2

I don't have your SSAS database so I can't test the syntax, but I believe you would need to write your MDX as follows (notice the THIS= addition):

SCOPE ([Measures].[Total]); 
THIS = SUM([Data Source].[Interpolation Method].&[3],[Measures].[Total]); 
END SCOPE; 

See the documentation for syntax details.

1

Some measures, even though they are numeric, makes no sense as SUM. Temp, Datekey (could be numeric) and others. The solution is to mark this measure as non-aggregate in the measure tab. This way it won't be aggregated.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.