Distinct count on several dimension members


Here is an example on how you can select the distinct count on a combination of product categories.
The example is written for FoodMart 2000

WITH   

SET [Categories] AS ' 
	{[Product].[All Products].[Drink].[Alcoholic Beverages].[Beer and Wine]} 
	+ 
	{[Product].[All Products].[Drink].[Beverages].[Carbonated Beverages]}'  
MEMBER [Measures].[Count] AS 'SUM( {[Categories]}, [Measures].[Sales Count] )' 
MEMBER [Measures].[Count A] AS 'SUM( 
	{[Product].[All Products].[Drink].[Alcoholic Beverages].[Beer and Wine]}, 
	[Measures].[Sales Count] )' 
MEMBER [Measures].[Count B] AS 'SUM( 
	{[Product].[All Products].[Drink].[Beverages].[Carbonated Beverages]}, 
	[Measures].[Sales Count] )' 
SELECT 
{ [Measures].[Count], [Measures].[Count A], [Measures].[Count B] } ON COLUMNS, 
NON EMPTY DESCENDANTS( [Customers] ) ON ROWS   

FROM   

[Sales]
Reklamer

Skriv et svar

Udfyld dine oplysninger nedenfor eller klik på et ikon for at logge ind:

WordPress.com Logo

Du kommenterer med din WordPress.com konto. Log Out / Skift )

Twitter picture

Du kommenterer med din Twitter konto. Log Out / Skift )

Facebook photo

Du kommenterer med din Facebook konto. Log Out / Skift )

Google+ photo

Du kommenterer med din Google+ konto. Log Out / Skift )

Connecting to %s

%d bloggers like this: