Someone had already posted a similar question so I’ll just be reposting that:
Please help. For context, 1 user can have multiple generations of a product.
Generation 1
Generation 2
Generation 3
I want to isolate users by grouping these generational products into
A: Generation 1 only users
B: Generation 2 only users
C: Generation 3 only users
😧 Generation 1 AND Generation 2 users
I also want to look at users who have Generation 1 and Generation 2.
My first idea was to isolate only users who have had a Generation 1 item exclusively meaning they haven't any other products from the line.
I cannot seem to get anything to run properly.
LookML start to my code. I first tried to isolate Generation 1 only users then building the query or code from there.
dimension: customer_type {
case: {
when: {sql: ${TABLE}.product_family IN "Generation 1"}
AND ${TABLE}.product_family NOT IN ("Generation 2")
OR ${TABLE}.product_family NOT IN ("Generation 3");;
label: "Generation 1 only users"
}
else: "Other"
}
}
When I create the custom dimension in Looker, the output either spits out:
Generation 1
Generation 2
Generation 3
OR
Generation 1 + 2
Generation 3
What I would like to see is :
Generation 1
Generation 2
Generation 3
Generation 1 + 2