LKML Impossibleventures

Cleaning Process Runs View

Cleaning Process Runs View model for impossibleventures.

inferred

Blocks

cleaning_process_runs_view.view.lkml · 100 lines
inferred
view: cleaning_process_runs_view {
  sql_table_name: public.cleaning_process_runs ;;

  dimension: duration {
    type: int
    sql: ${TABLE}.duration ;;
  }

  dimension: error_name {
    sql: ${TABLE}.error_name ;;
  }

  dimension: is_allowable {
    type: yesno
    sql: ${TABLE}.is_allowable ;;
  }

  dimension: results_count {
    type: int
    sql: ${TABLE}.results_count ;;
  }

  dimension: run_id {
    type: int
    sql: ${TABLE}.run_id ;;
  }

  dimension: tld {
    sql: ${TABLE}.tld ;;
  }

  dimension: url {
    sql: ${TABLE}.url ;;
  }

  dimension: version {
    sql: ${TABLE}.version ;;
  }

  dimension_group: recording {
    type: time
    timeframes: [time, date, week, month]
    sql: ${TABLE}.recording_time ;;
  }

  dimension_group: created_at {
    type: time
    timeframes: [minute, hour, date]
    convert_tz: no
    sql: ${TABLE}.recording_time ;;
  }

  measure: count {
    type: count
    drill_fields: [error_name]
  }

  measure: count_total_errors {
    type: count
    filters: [error_name: "-'NULL'"]
    drill_fields: [error_name]
  }

  measure: count_non_allowable_errors {
    type: int
    drill_fields: [run_id, recording_time, error_name, is_allowable]
    sql: SUM(CASE WHEN is_allowable='false' THEN 1 ELSE 0 END) ;;
  }

  measure: count_allowable_errors {
    type: int
    drill_fields: [run_id, recording_time, error_name, is_allowable]
    sql: SUM(CASE WHEN is_allowable='true' THEN 1 ELSE 0 END) ;;
  }

  measure: non_allowbale_error_rate {
    type: int
    value_format: "0.00\%"
    sql: ROUND(((SUM(CASE WHEN is_allowable='false' THEN 1 ELSE 0 END))::decimal / COUNT(*) * 100),4) ;;
  }

  measure: allowbale_error_rate {
    type: int
    value_format: "0.00\%"
    sql: ROUND(((SUM(CASE WHEN is_allowable='true' THEN 1 ELSE 0 END))::decimal / COUNT(*) * 100),4) ;;
  }

  measure: all_durations_avg {
    type: avg
    value_format: "#,##0"
    sql: ${TABLE}.duration ;;
  }

  measure: non_errors_durations_avg {
    type: avg
    value_format: "#,##0"
    filters: [error_name: "-'NULL'"]
    sql: ${TABLE}.duration ;;
  }
}
cleaning_process_runs_view.view.lookml · 83 lines
source-preserved
- view: cleaning_process_runs_view
  sql_table_name: public.cleaning_process_runs
  fields:
  - dimension: duration
    type: int
    sql: ${TABLE}.duration
  - dimension: error_name
    sql: ${TABLE}.error_name
  - dimension: is_allowable
    type: yesno
    sql: ${TABLE}.is_allowable
  - dimension: results_count
    type: int
    sql: ${TABLE}.results_count
  - dimension: run_id
    type: int
    sql: ${TABLE}.run_id
  - dimension: tld
    sql: ${TABLE}.tld
  - dimension: url
    sql: ${TABLE}.url
  - dimension: version
    sql: ${TABLE}.version
  - dimension_group: recording
    type: time
    timeframes:
    - time
    - date
    - week
    - month
    sql: ${TABLE}.recording_time
  - dimension_group: created_at
    type: time
    timeframes:
    - minute
    - hour
    - date
    convert_tz: false
    sql: ${TABLE}.recording_time
  - measure: count
    type: count
    drill_fields:
    - error_name
  - measure: count_total_errors
    type: count
    drill_fields:
    - error_name
    filters:
    - error_name: '-''NULL'''
  - measure: count_non_allowable_errors
    type: int
    drill_fields:
    - run_id
    - recording_time
    - error_name
    - is_allowable
    sql: SUM(CASE WHEN is_allowable='false' THEN 1 ELSE 0 END)
  - measure: count_allowable_errors
    type: int
    drill_fields:
    - run_id
    - recording_time
    - error_name
    - is_allowable
    sql: SUM(CASE WHEN is_allowable='true' THEN 1 ELSE 0 END)
  - measure: non_allowbale_error_rate
    type: int
    value_format: '0.00\%'
    sql: ROUND(((SUM(CASE WHEN is_allowable='false' THEN 1 ELSE 0 END))::decimal / COUNT(*) * 100),4)
  - measure: allowbale_error_rate
    type: int
    value_format: '0.00\%'
    sql: ROUND(((SUM(CASE WHEN is_allowable='true' THEN 1 ELSE 0 END))::decimal / COUNT(*) * 100),4)
  - measure: all_durations_avg
    type: avg
    value_format: '#,##0'
    sql: ${TABLE}.duration
  - measure: non_errors_durations_avg
    type: avg
    value_format: '#,##0'
    filters:
    - error_name: '-''NULL'''
    sql: ${TABLE}.duration

Contents

  • cleaning_process_runs_view.view.lkml
  • cleaning_process_runs_view.view.lookml