Is there a way to count unique numbers in a column in Tableau?
COUNT(IF [Type] = "Boxes" AND [Ordernumber] is unique THEN 1 END)
In my data, several rows have the same order number. I want all the rows where [Type] = "Boxes" AND have a unique order number. Example:
Type | Ordernumber |
---|---|
Boxes | 10000000 |
Boxes | 10000000 |
Boxes | 10000001 |
Misc | 10000002 |
Boxes | 10000003 |
Should be equal to 2.
Here’s one approach, relatively easy.
Note, it is possible that you want different semantics regarding the Type="boxes" filter. Perhaps you want to first eliminate orders with multiple rows and then afters only view the records with boxes. If so, experiment with changing which filter(s) is (are) in the context to see the impact of applying the filters in different orders.