I have created two groups on a customer level (all with distinct customer IDs) based on some criterias. But I am having difficulties grouping these on a group level (group ID). The data structure is a follows: a customer has one customer ID and a group ID. The customer ID is distinct but the group ID is not; i.e. multiple customers (customer IDs) are part of a group and therefore have the same group ID.
My tableau code looks something like this:
IF [Sales] >= 200000 and [Category] = 'A'
OR [CAC] <= 10000 and [Category] = 'A'
THEN 'Good customer'
ELSE 'Bad customer'
END
The above code gives me the grouping on a customer level. However, I want to see the group level, i.e. if just one customer from a group is a 'Good customer' then the entire group should be classified as a 'Good customer'. This means that if just one customer from the group is classied as a 'Good customer' then all the [Sales] and [CAC] of the customers within the particular group should be summed up on a group level and displayed under 'Good customer' on a group level instead of on customer level.