calculate customer repeat rates

I am trying to create a measure(customer repeat rates) something like this but did not got lucky so far, can anyone help me in this?

measure: count_repeat_customers {
    type: count
    sql: 
        CASE WHEN ${count}>1
        THEN ${name}
        END;;
  }
  


  measure: Repeat_customer_rate {
    type: number
    sql: ${count_repeat_customer}/${count} ;;
  }

PS- ${count} here counts all the names of customers in the db irrespective of the distinct nature

0 0 274
0 REPLIES 0
Top Labels in this Space
Top Solution Authors