Calculating Bounce Rates


#1
  measure: core_visits.count {
    type: count
    detail: detail
    filters: 
      core_view: 1 to
  }

  measure: unique_visitors_count {
    type: count_distinct
    detail: detail
    sql: ${TABLE}.user_id
    filters:
      core_view: 1 to
  }

  measure: bounce.rate_unique_visits {
    type: number
    decimals: 2
    sql: 1.0 * count(distinct case when bounce then user_id end)/${unique_visitors_count} * 100.0
  } 

  measure: bounce.rate_visits {
    type: number
    decimals: 2
    sql: 1.0 * count(distinct case when bounce then user_id end)/${visits_count} * 100.0
  }