Tuesday, February 21, 2012

Returning Dimension Values with no Measures

I have a need to return data in a report(matrix) that would show all attributes for a given dimension, even if those attributes had no measure data for those given values. In other words, if I was creating a matrix with quarter going down the x-axis, and sales region going across the y-axis, with sales amount as my financial values, I would want to display sales region across the y-axis even if there were no values. Has anyone been able to do this successfully? I am using reporting services on top of an analysis services cube.

Sure, the following query should give you what you want (please correct for naming of dimensions/attributes):

SELECT {[Measures].[Sales Amount]} ON 0,
CROSSJOIN([Date].[Quarter].[Quarter].members, [Sales Region].[Sales Region].[Sales Region].members) ON 1
FROM [MyCube]

|||

Michael-

Is there a way I can do this without writing MDX? We are using Reporting Services Report Designer, and trying to avoid writing MDX as much as possible. I can do it if need be.

Thanks!

|||I don't recall if there is a "show empty cells" option in the MDX Query Designer in RS Report Designer, but this is what you should look for. Basically, the query designer constructs MDX for you behind the scenes, and what you could do instead of setting the "show empty cells" is to edit this MDX and remove the "NON EMPTY" keyword from the query.|||Thanks Michael, There is a "show empty Cells option", however it returns more than I need, I have been able to work around this on the reporting side by filtering.

No comments:

Post a Comment