Question

calculate customer repeat rates

  • 17 June 2021
  • 0 replies
  • 12 views

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 replies

Be the first to reply!

Reply