Saturday, February 25, 2012

Overriding repeating totals from non-referenced slicer dimension

I've run across what appears to be a change in the default behavior of Analysis Services from 2000 to 2005. My question is how to get the default behavior to revert to the AS 2000 method.

If you have a cube with multiple measure groups or multiple linked cubes, queries that try to slice a measure using a dimension that is not related to the measure result in the total amount for any other slicers being repeated across the "invalid" slicer.

For example, the following query slices the reseller amount by calendar year and employee department. The results are as expected. Only the Sales department has any totals for the measure and all other departments return null.

SELECT { [Employee].[Employee Department].[All Employees].CHILDREN } ON COLUMNS ,{ DESCENDANTS( [Date].[Calendar].[All Periods], [Date].[Calendar].[Calendar Year] ) } ON ROWS FROM [Adventure Works] WHERE ( [Measures].[Reseller Sales Amount] );

The next query is identical, except it using the Internet Sales Amount measure, which comes from a measure group that does not have a link to the Employee dimension. The result is the total amount for internet sales is displayed across all employee departments. In AS 2000, the results would have been null or empty.

SELECT { [Employee].[Employee Department].[All Employees].CHILDREN } ON COLUMNS ,{ DESCENDANTS( [Date].[Calendar].[All Periods], [Date].[Calendar].[Calendar Year] ) } ON ROWS FROM [Adventure Works] WHERE ( [Measures].[Internet Sales Amount] );

At one level I can agree with the change, but non-the-less, it is a change in the default behavior, and users hate it. Is ther any way to revert this behavior back to the AS 2000 approach?

Thanks!

What you are running into is the fact that AS2K5 now applies ValidMeasure() automatically. You can revert back to AS2K behavior by setting the "IgnoreUnrelatedDimensions" property associated with your measure group to "False".

HTH,

- Steve

|||

Steve,

Many thanks! I knew it would be something simple, but was getting tired of looking...

No comments:

Post a Comment