dbTalk Databases Forums  

distinct count problem

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


Discuss distinct count problem in the microsoft.public.sqlserver.olap forum.



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

Default distinct count problem - 10-20-2003 , 06:45 AM







Hi,



I have fact table with column buying customer id where I put customer
id when he has bought something or null when he has not (during
emploee visit).

I would like to have measure that tells me the number of buying
customers. So I created a measure on mentioned column with agregate
function distinct count. But distinc count counts null as one of values
so sometimes I get result which is acutal number of buying customers
plus one (null). Any hints on workaround?



Thanks in advance

Bartlomiej Bojko


--
Posted via http://dbforums.com

Reply With Quote
  #2  
Old   
Sean Boon [MS]
 
Posts: n/a

Default Re: Distinct Count Problem - 02-18-2004 , 02:45 PM






You won't be able to do this using the distinct count aggregate. Instead
you can use the approach outlined in the following whitepaper. It's a
different topic, but the technique described should be applicable.

http://msdn.microsoft.com/library/de.../distinct2.asp


--
Sean

--
Sean Boon
SQL Server BI Product Unit

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.


"Montechristo" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hello,

I'm having a problem implementing following requirement:

I ned to display the distinct count of customers that had sales in the
last two years per SalesEngineer.
(having salesengineer, customers and of course time as dimensions)

I tried different solutions based upon distinct count measures and
seperate cubes, used the distinct count MDX function with filter, but there
just seems to be no solution to show the customer count that had sales the
last two years (per salesengineer and even on day level going back two
years).
Quote:
I also tried building the count in the FACT-View but the Analysis Server
couldn't handle the Aggregations correctly.

By now I even doubt this is possible ... I'd like you to prove the
opposite please :-)




Reply With Quote
  #3  
Old   
Montechristo
 
Posts: n/a

Default Re: Distinct Count Problem - 02-19-2004 , 11:01 AM



Thx alot ...!
it works! (though there are still some performance considerations ... really looking forward to OWC 2003 where calculated measures are processed server-side ;-) )

Reply With Quote
  #4  
Old   
Michael Vardinghus
 
Posts: n/a

Default Re: Distinct Count Problem - 02-20-2004 , 02:08 PM



What ... ?

There is already the execution location property - we tried to use it in a
model with LOTS of calc measueres with not much luck. Does this mean
that this will be improved - or the calc measures will be added to the
aggregations in the cube ?


Montechristo <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Thx alot ...!!
it works! (though there are still some performance considerations ...
really looking forward to OWC 2003 where calculated measures are processed
server-side ;-) )




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.