0 votes
1 view
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, 

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.

Related questions

0 votes
1 answer
0 votes
0 answers
asked Aug 27, 2019 in BI by Vaibhav Ameta (17.6k points)
0 votes
1 answer
0 votes
2 answers
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...