Forum Discussion
How to Count Unique Customers Based on Only Having Specific Values
- 4 years ago
Hello all,
I tried all of your solutions to my real dataset but the second measure for counting a food group that is meat and either fruit or vegetable or both doesn't account for a customer that has 2 or more of each. For example,
Table1
| Customer Name | Food Group |
| Aaron | Fruit |
| Bill | Fruit |
Chris | Meat |
Chris | Vegetable |
Derek | Vegetable |
Derek | Fruit |
Eric | Vegetable |
Francine | Meat |
Francine | Fruit |
Francine | Vegetable |
George | Meat |
George | Meat |
George | Vegetable |
George | Fruit |
Heather | Meat |
Heather | Meat |
Isabel | Fruit |
Isabel | Meat |
Isabel | Fruit |
Isabel | Fruit |
Joe | Meat |
Joe | Meat |
Joe | Vegetable |
Kevin | Meat |
In this updated table, George, Isabel and Joe should be considered in the second measure.
Also, since there is a total of 11 unique customers and Heather and Kevin doesn't fit in either measures, (1st measure has Aaron, Bill, Derek, Eric {4 total}), (2nd measure has Chris, Francine, George, Isabel, Joe {5 total}, is it correct to assume that the difference between the total unique customers and sum of both the measures is the total number of customers that only have a food group of meat, which is 2 in this case (Heather, Kevin)?
In my real dataset, it is substantially bigger, so the difference isn't clearer to me if I could make that assumption.
Thank you!
- Ashish_Mathur4 years ago
Super User
- Anonymous4 years agoNot applicable
Thank you. This is what I was looking for!
- Ashish_Mathur4 years ago
Super User
You are welcome.