dbTalk Databases Forums  

trouble with distinccount..

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


Discuss trouble with distinccount.. in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
algkep@gmail.com
 
Posts: n/a

Default trouble with distinccount.. - 09-15-2005 , 01:33 AM






Hello,

I have a cube with a lot of dimensions. Two of them are ItemNo and
LocationCode. I need to have two measures "Locations Shipped To" and
"Item Count". For those, I need to have a count of different
locations/items matching current dimension filters. So I tried adding a
calculated member:

distinctcount({[Item].Members})

but it only shows 0 or 1

Am I missing something here?

thanks.


Reply With Quote
  #2  
Old   
Jéjé
 
Posts: n/a

Default Re: trouble with distinccount.. - 09-15-2005 , 06:24 PM






how many members your item dimension have?

try: distinctcount(Item.ItemNo.Members)



<algkep (AT) gmail (DOT) com> wrote

Quote:
Hello,

I have a cube with a lot of dimensions. Two of them are ItemNo and
LocationCode. I need to have two measures "Locations Shipped To" and
"Item Count". For those, I need to have a count of different
locations/items matching current dimension filters. So I tried adding a
calculated member:

distinctcount({[Item].Members})

but it only shows 0 or 1

Am I missing something here?

thanks.




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

Default Re: trouble with distinccount.. - 09-16-2005 , 12:21 AM



It has around 500 members. I'm not sure what happened there, but it
seems to work correctly now. But it still messes up in some cases. For
examply: I have another dimension "Net". If I put it to heading, and
filter by one Net, it shows correct amount of Items. But if I select
two Nets ("select multiple" in excel), then it shows total number, as
if it wouldnt filter by Net at all. Any ideas? =/


Reply With Quote
  #4  
Old   
Jéjé
 
Posts: n/a

Default Re: trouble with distinccount.. - 09-16-2005 , 06:06 PM



distinctcount measures doesn't support multiple filtered members like you
try.

to solve this issue, you have to create a dynamic dcount:
count(crossjoin(items.noitem.members, {measures.simplecount}), excludeempty)


"mrQQ" <algkep (AT) gmail (DOT) com> wrote

Quote:
It has around 500 members. I'm not sure what happened there, but it
seems to work correctly now. But it still messes up in some cases. For
examply: I have another dimension "Net". If I put it to heading, and
filter by one Net, it shows correct amount of Items. But if I select
two Nets ("select multiple" in excel), then it shows total number, as
if it wouldnt filter by Net at all. Any ideas? =/




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

Default Re: trouble with distinccount.. - 10-02-2005 , 06:17 AM



Sorry for taking so long to reply.

That's very interesting. I had a suspicion that it wouldnt be
supported.

This example of yours.. What is measures.simplecount in there? Is it
distinctcount(Item.ItemNo.Members)
or is it something else?

thanks!


Reply With Quote
  #6  
Old   
Jéjé
 
Posts: n/a

Default Re: trouble with distinccount.. - 10-02-2005 , 09:37 AM



simplecount is a ... simple count !
take any column in your fact table as a new measure, setup the aggregation
to count, then hide it. you can use an existing count measure if you
allready have one.


"mrQQ" <algkep (AT) gmail (DOT) com> wrote

Quote:
Sorry for taking so long to reply.

That's very interesting. I had a suspicion that it wouldnt be
supported.

This example of yours.. What is measures.simplecount in there? Is it
distinctcount(Item.ItemNo.Members)
or is it something else?

thanks!




Reply With Quote
  #7  
Old   
mrQQ
 
Posts: n/a

Default Re: trouble with distinccount.. - 10-03-2005 , 03:45 PM



thanks, i will try it


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.