view: int_prod_vw_performance_rights_delivery_history { sql_table_name: intelligence.prod.vw_performance_rights_delivery_history ;; dimension: id { type: number sql: ${TABLE}.id ;; hidden: yes } dimension: tuid { label: "TUID" type: number sql: ${TABLE}.tuid ;; value_format: "0" hidden: yes } dimension: isrc { label: "ISRC" type: string sql: ${TABLE}.isrc ;; hidden: yes } dimension: label_id { type: number sql: ${TABLE}.label_id ;; value_format: "0" hidden: yes } dimension: active { type: yesno sql: ${TABLE}.active = 1 ;; } dimension: society_id { type: number sql: ${TABLE}.society_id ;; value_format: "0" } dimension: society_name { type: string case: { when: { sql: ${TABLE}.society_id = 1 ;; label: "SoundExchange (USA)" } when: { sql: ${TABLE}.society_id = 2 ;; label: "ConnectMusic (Canada)" } when: { sql: ${TABLE}.society_id = 3 ;; label: "PPL (United Kingdom)" } when: { sql: ${TABLE}.society_id = 4 ;; label: "AGEDI (Spain)" } when: { sql: ${TABLE}.society_id = 5 ;; label: "SCPP (France)" } when: { sql: ${TABLE}.society_id = 7 ;; label: "GVL (Germany)" } when: { sql: ${TABLE}.society_id = 9 ;; label: "PPCA (Australia)" } when: { sql: ${TABLE}.society_id = 10 ;; label: "IFPI (Sweden)" } when: { sql: ${TABLE}.society_id = 12 ;; label: "SIMIM (Belgium)" } when: { sql: ${TABLE}.society_id = 28 ;; label: "SCF (Italy)" } else: "" } } dimension: status_id { type: number sql: ${TABLE}.status_id ;; value_format: "0" } dimension: status_name { type: string case: { when: { sql: ${TABLE}.status_id = 1 ;; label: "Delivered" } when: { sql: ${TABLE}.status_id = 2 ;; label: "Trashed" } when: { sql: ${TABLE}.status_id = 3 ;; label: "Withdrawn" } when: { sql: ${TABLE}.status_id = 4 ;; label: "Generated / Unconfirmed" } else: "" } } dimension: record_updated { label: "Date Record Updated" type: date sql: ${TABLE}.record_updated ;; } dimension: date_delivered { type: date sql: ${TABLE}.date_delivered ;; } dimension: comment { type: string sql: ${TABLE}.comment ;; } measure: count_records { type: count_distinct sql: ${TABLE}.id ;; } measure: count_label { label: "Count Labels" type: count_distinct sql: ${TABLE}.label_id ;; } measure: count_tuid { label: "Count TUIDs" type: count_distinct sql: ${TABLE}.tuid ;; } measure: count_isrc { label: "Count ISRCs" type: count_distinct sql: ${TABLE}.isrc ;; } }