Quantcast
Channel: SQL Server Analysis Services Forum
Viewing all articles
Browse latest Browse all 2472

MDX Distinct Count

$
0
0

I am trying to count the policy rows returned by this MDX into the three colors.  What's the simplest way to accomplish this.

SELECT [Measures].[Policy Count] ON COLUMNS,
NON EMPTY 
		{[Policy].[Color].[Color] *
		[Policy].[Policy Number].[Policy Number]
		} ON ROWS
FROM (SELECT [Policy Hierarchy].[Imo ID].&[xxxxxxxx] ON COLUMNS  
FROM [Policy] ) 

The end result should look like this.

	Policy Distinct Count
Green	42
Red	31
Yellow	3

Everything I've tried to implement gives unexpected results or fails with error.

Here is a similar scenario using Adventure Works.

SELECT [Measures].[Amount] ON COLUMNS,
NON EMPTY 
		{[Account].[Account Type].[Account Type] 
		* [Account].[Account Number].[Account Number]
		} ON ROWS
FROM [Adventure Works]
I just want a Count of Accounts by Account Type.

Viewing all articles
Browse latest Browse all 2472

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>