dbTalk Databases Forums  

Distinct count on Fact table

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Distinct count on Fact table in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
James
 
Posts: n/a

Default Distinct count on Fact table - 02-04-2004 , 10:09 AM






We have a fact table in a retail application containing a
transaction number. For each sale, we have the following
fact:
Time, Amount, Item, TransactionNumber

We need to create a measure that gives us the DISTINCT
COUNT of TransactionNumber.

Can someone help me with the MDX needed to create the
measure?

Thanks,

James.

Reply With Quote
  #2  
Old   
Tom Chester
 
Posts: n/a

Default Re: Distinct count on Fact table - 02-04-2004 , 10:48 AM






Are you aware that a measure can be defined as distinct count?

public @ the domain below
www.tomchester.net

"James" <news (AT) att (DOT) com> wrote

Quote:
We have a fact table in a retail application containing a
transaction number. For each sale, we have the following
fact:
Time, Amount, Item, TransactionNumber

We need to create a measure that gives us the DISTINCT
COUNT of TransactionNumber.

Can someone help me with the MDX needed to create the
measure?

Thanks,

James.



Reply With Quote
  #3  
Old   
Molly Blecker
 
Posts: n/a

Default Re: Distinct count on Fact table - 02-04-2004 , 05:36 PM



If you go to the Measure and look at basic properties, you will find the aggregate function property that you can change to distinct count. You can only have ONE per cube and I found when I tried to create a distinct count, that the measure I had to be numeric.

I had a client number which is a varchar field, and it wouldn't let me set it to distinct count. When I created a new field, which was an integer identity column, I could then pick distinct count on the aggregate function property of the measure

Molly

Reply With Quote
  #4  
Old   
James
 
Posts: n/a

Default Re: Distinct count on Fact table - 02-05-2004 , 01:58 AM



Many thanks Molly, that sure looks like my problem, the
transaction number is defined as nvarchar for some reason.
I'll create a view on the fact table to show that column
as int, and I should be all set.



Quote:
-----Original Message-----
If you go to the Measure and look at basic properties,
you will find the aggregate function property that you can
change to distinct count. You can only have ONE per cube
and I found when I tried to create a distinct count, that
the measure I had to be numeric.
Quote:
I had a client number which is a varchar field, and it
wouldn't let me set it to distinct count. When I created a
new field, which was an integer identity column, I could
then pick distinct count on the aggregate function
property of the measure.
Quote:
Molly
.


Reply With Quote
  #5  
Old   
James
 
Posts: n/a

Default Re: Distinct count on Fact table - 02-05-2004 , 02:10 AM



I'm experiencing the following problem:

"The cube contains a distinct count measure, and at least
one of the enabled levelsin the dimensions used in this
cube contains a custom rollup definition."

Do you know a workaround?

Reply With Quote
  #6  
Old   
Sanka
 
Posts: n/a

Default Re: Distinct count on Fact table - 02-05-2004 , 09:34 AM



Because DISTINCT COUNT aggregarion doesn't support custom
aggregations, the use of this aggregation function in
combination with CustomRollupExpression and
CustomRollupColumn properties is not supported.

HTH,
Sanka

Quote:
-----Original Message-----
I'm experiencing the following problem:

"The cube contains a distinct count measure, and at least
one of the enabled levelsin the dimensions used in this
cube contains a custom rollup definition."

Do you know a workaround?
.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.