Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Count Distinct Totals via Category Count

Count Distinct Totals via Category Count

Count Distinct Totals via Category Count

I have a cube created via transformer which does a category count on supplier name. If I go into analysis studio and use the Supplier Count measure by country, everything works. It'll show something like:

United States - 100
Canada - 50
Mexico - 25
Total - 130

So I know that there are a total of 130 distinct suppliers being used across NA, some of them are used in multiple countries.

Now, if i want to determine the distinct number of suppliers used in just Mexico and Canada, it won't calculate the total properly. If I drag just Mexico and Canada into the Rows, it'll show this:

Mexico - 25
Canada - 50
Total - 130

It still shows the overall total. Same thing happens if I put Mexico and Canada into the Context Filter box and replace the rows with Year or something. It'll show:

Context Filter = Canada, Mexico

Year 2012 - 130
Total - 130

No matter what I try, I cannot get Analysis Studio to count the distinct number of suppliers using a combination of items within a level... it will always show the overall total for the highest level all items belong to.

Any ideas on how to get around this? The same issue is happening when I report using AS or Report Studio, so is this a cube limitation?

RE: Count Distinct Totals via Category Count

I'm no cube expert , but this used to be a drawback of dimensional models. Did you search for an MDX function that might do the trick? This won't be of any use in AS, but RS can handle MDX just fine..


Ties Blom

RE: Count Distinct Totals via Category Count

Thanks for the info... maybe I'll be able to get it working in Report Studio, at least.

RE: Count Distinct Totals via Category Count

Hmm... it doesn't seem to be working. The distinctcount function doesn't seem to be supported at all by Cognos. And when I add a dataitem to the query like:

count( distinct [Supplier Name] for [Invoice Year],[Invoice Month])

validation gives me "A syntax error was detected near 'count'".

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close