-
(MDX). Count 2 Dimensions in a Cube
Hi everyone.
suppose that i have 3 dimensions as.
ProductModel and Color
and SalesFact table.
i want to find the distinct count of ProductModel+Color.
i mean.
Year/ProductModel/Color/Sales
---------------
2006/010101 /White /1.0
2006/010101 /Black /2.0
2007/010101 /White /1.0
2006/010102 /White /1.0
2007/010102 /Black /3.0
2007/010103 /White /2.0
i am trying to add CalculatedMember in AS2000.
i can easily count ProductModel with.
Code:
iif(filter(descendants([ProductModel ],[ProductModel ].[Model Id]),[Measures].[Sales]<>0).count=0,
null,filter(descendants([ProductModel ],[ProductModel ].[Model Id]),[Measures].[Sales]<>0).count)
and i can get. By year
2006 - 010101 - 2
2007 - 010101 - 1
2006 - 010102 - 1
2007 - 010102 - 1
2007 - 010103 - 1
But i want to get count of ProductModel+Color
i mean.
i want see.
Year/ ModelCount/Model+colorCount
2006 - 2 - 3
2007 - 2 - 3
it means
2006 - 2(010101&010102) - 3 (010101White&010101Black&010102White)
i hope someone understand my question...
-
i just want to add second Dimension to this member formula query.
i wat to add [Colors].[Color ID] to this query.
filter(descendants([ProductModel ],[ProductModel ].[Model Id]),[Measures].[Sales]<>0).count)
Sortly;
i want distinct count of two dimensions ((
-
ok. i found it.
no problem
-
NonEmptyCrossJoin ({[Measures].[Miktar]},
{Descendants ([Stoklar].CurrentMember, [Stoklar].[Model Id])},
{Descendants ([Renkler].CurrentMember, [Renkler].[Renk ID])}
).Count
-
Not Really a "Count of Two Dimensons ..."
What you got was a count of items returned via the crossjoin - which happened to juxtapose three dims (two dims and a measure, in 2k parlance) ...
Great to hear it was what you wanted ...
Keep us posted on your progress!
Bill
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|