i want to create a segmentation for my customer based on three things:
- Days since last purchase (This comes from a query that has user_id, min(day_since_last_purchase) from X) – i need to do the min because there are multiple profiles per user and i want to know the min per user regardless the profile
- % change in communications MoM (this comes froma. query that has the following info user_id, date_, q_communications)
I want the following groups:
- if % change in communications >0 and days since last login>7 then group A
- if % change in communications >0 and days since last login<7 then group B
3.% change in communications <0 and days since last login>7 then group C - % change in communications <0 and days since last login<7 then group D
so i try the followoging
ifelse(% change in communications <0 and days since last login<7,“Group D”,
% change in communications >0 and days since last login<7,"Group B, …)
however when i do the ifelse function i need to aggregate non-aggregated with aggregated fields so i keep receiving the error: " [Mismatched aggregation. Custom aggregations can’t contain both aggregated and nonaggregated fields, in any combination)"
Any ideas? Thanks!
Any ideas?