Hi, I am still new in Tableau and I hope someone can help me.
I want to count total customer but I have a condition to consider. I have customer data represent as cif no and each cif no subscribe a few product that I created as tag.
List of column
1. cif no
2. Credit Card (product)
3. Debit Card (product)
4. IB (product)
5. GO (product)
6. Tagging (active/inactive)
where I'm stuck right now is for product IB & GO must include tagging "active" to find total customer. How can I calculate the count without excluding other product.
Here I provide sample data for reference. Thank you so much for the help.
With your current data structure, you can use this calculation
COUNTD
(IF [Tagging]="ACTIVE" AND [GO]="GO"
THEN [Cif No]
END)
I assumed you wanted a distinct count of customers, so I used COUNTD. If you want all rows, you can change it to COUNT. For this calculation the difference is only 2 (i.e. two customers appear twice)
For each row, Tableau will check if both Tagging is equal to 'Active' and GO is equal to 'GO'. If both are true, Tableau will pass through the [Cif No]; if either is FALSE, the nothing is passed on (i.e., the cell will be NULL). The COUNTD counts all the values that were passed through.
Depending on your plans, it might be better to pivot the data, so that you have one Product field and a value to show whether the customer has that product.
If you pivot the data as is, each customer will appear on 4 rows (one for each product). Either from the source or through cleaning, you could eliminate customer-product pairs that are NULL.