Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in BI by (17.6k points)

I'm using Tableau 8.3 and I'm trying to find out how to group on each of the values that I find after making a "count of distinct values".

To illustrate the case I have made a fictive dataset that includes 58 rows (buys), 7 different IDs (customers) and 5 different products. Then I have made a count distinct to find out how many of the 5 different products each ID has bought. It looks like this.

ID1 = 4

ID2 = 4

ID3 = 5

ID4 = 4

ID5 = 3

ID6 = 4

ID7 = 2

Now I want to turn the view around and find out how many of the IDs who have bought X different products. It should ultimately look like this.

2 = 1

3 = 1

4 = 4

5 = 1 

I hope to find a solution by posting here! Thank you, 

closed

1 Answer

0 votes
by (47.2k points)
selected by
 
Best answer
  • You need to update to Tableau 9.0 to achieve that (in a fast way).

  • You can create a calculated field named #of products:

{ FIXED [id_customer] : COUNTD([id_product]) }

  • Then you can cross the [# of products] with COUNTD(id_customer) to get what you want.

  • You need to create a new table in a proper format (1 line per customer with the aggregations) and connect to it in older versions of Tableau.

You can enroll in this Best Tableau Certification course online by Intellipaat to learn basic and advanced Tableau. 

Related questions

0 votes
1 answer
asked Aug 27, 2019 in BI by Vaibhav Ameta (17.6k points)
0 votes
3 answers
0 votes
2 answers

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...