I think I understand your question. You would like a count of the number of records of two dimensions (ex: Life Product, Life Client ID). That's quite easy to do in Tableau (see example), drag your two dimensions to the row shelf, then drag the number of records to the text shelf for a table type view.
Please let me know if I have the wrong interpretation.
Count Example.twbx.zip 1.1 MB
This solution is partly correct in terms of doing the count.
However the question I'm trying to answer from the data set is as follows:
1. How many unique customers(Life Client ID), I have per product type
2. I can't simply do a count distinct as in this data set ( I have multiple customers across different product types meaning same customer can have different products)
So I'm after a view that can produce the following table.
Hope the question is clearer now?
Product Type A
Product Type B
Product Type C
Total number of unique
customers(Life Client ID)
Total number of
records(number of records in the database with Product Type A)
I thought you could use a count distinct function against a dimension to break out results, but for some reason count distinct is not showing up in the workbook I attached to my previous post....hmm. I'm going to try and noodle around and see if I can get you a better answer.
1 of 1 people found this helpful
[Pssst, Ben you'll need to do an extract to get at COUNTD() function.]
You can use a count distinct against multiple dimensions to return the result you want. One tricky item is that count Distinct will not work with certain live connections KB article here:
The attached workbook has a simple two product five customer matrix
Product Customer Number Date of Purchase A 1 10/1/2012 A 2 10/2/2012 A 3 10/3/2012 A 4 10/4/2012 A 4 10/5/2012 B 1 10/6/2012 B 2 10/7/2012 B 4 10/8/2012 B 5 10/9/2012 B 5 10/10/2012
The attached workbook calculates correctly the four distinct customers for each product. Hope this is the answer you are looking for!
Count Distinct Example.twbx.zip 10.8 KB
Perfect, this solves most of my problem. Not sure this is the best possible way though?
Now I have an additional filter I want to apply for records - a calculated field.
Say for example I want to class the customers in the above example as a multi-product buying customer.
Idea behind me introducing this flag is to find out
1.by product category, how many multi product buying customers are there?
Hope the question is clear?
I think I figured it out, used a boolean function on a table calculation for CountD for customers. See attached sheet 2, is this what you are looking for?
Count Distinct Example.twbx.zip 13.7 KB