Sample revenue aggregation / measures


#1
  measure: total_revenue {
    type: sum
    sql: ${revenue} ;;
    drill_fields: [detail*]
    html: ${{ rendered_value }}
      ;;
  }

  measure: avg_revenue {
    type: average
    sql: ${revenue} ;;
    html: ${{ rendered_value }}
      ;;
  }

  measure: final_revenue {
    type: sum
    sql: ${revenue} ;;

    filters: {
      field: isrefunded
      value: "no"
    }
    html: ${{ rendered_value }}
      ;;
  }

  measure: total_profit {
    type: sum
    sql: ${profit} ;;
    html: ${{ rendered_value }}
      ;;
  }