Count of greater than and less than values

Hi Everyone,

I have a dimension that calculates user engagement score and based on that I want to calculate the total number number of users based on each engagement type.

dimension: enagagement_score {
    label: "enagagement_score"
    group_label: "Engagement"
    type: number
    sql: (${scroll}/100) * 0.3 + (${time}/600) * 0.7 ;;
  }

#then another dimension

dimension: engagement_type {
label: "engagement_type"
type: string
group_label: "Engagement"
sql: CASE WHEN ${enagagement_score} <= .1 THEN 'Low' WHEN ((${enagagement_score} > .1) AND (${enagagement_score} <=.5)) THEN 'Medium' WHEN ${enagagement_score} > .5 THEN 'High' ELSE NULL END ;;
}

# Now I want to calculate the total number of Low, Medium and High engagement numbers

measure: engaged_user_low {
type: count_distinct
label: "engaged_user_low"
group_label: "Count"
sql: (${enagagement_score} <= .1);;
}

#but this is returning only 2 - presuming its just true and false.

How do I calculate total number of users based on each engagement type, i.e. Low, Medium and High.

Thanks

0 1 1,800
1 REPLY 1
Top Labels in this Space
Top Solution Authors