view: orch_app_ar_owner { sql_table_name: orchard_app_reporting_v2.art_relations_prod_art_relations.owner ;; suggestions:no dimension: owner_id { type: number sql: ${TABLE}.owner_id ;; description: "Owner ID" primary_key: yes } dimension: active_contract { type: yesno sql: ${TABLE}.active_contract = 'Y' ;; description: "If the contract is active Y/N" } dimension_group: agreement_end { type: time sql: ${TABLE}.agreement_end_date ;; description: "Agreement End Date" timeframes: [date, month, quarter, year] } dimension_group: agreement_start { type: time sql: ${TABLE}.agreement_start_date ;; description: "Agreement Start Date" timeframes: [date, month, quarter, year] } dimension: gras_sender_name { type: string sql: ${TABLE}.gras_sender_name ;; description: "" label: "GRAS Sender Name" } dimension: owner_abbreviation { type: string sql: ${TABLE}.owner_abbrivation ;; description: "Abbrevation for owner " } dimension: owner_is_sme { type: yesno sql: IFF(${TABLE}.owner_name LIKE '%SME%', TRUE, FALSE) ;; description: "If the Owner is SME or not" label: "Is SME" } dimension: owner_is_red { type: yesno sql: IFF(${TABLE}.owner_name LIKE '%RED%', TRUE, FALSE) ;; description: "If the Owner is RED or not" label: "Is RED" } dimension: owner_name { type: string sql: ${TABLE}.owner_name ;; description: "Owner Name" } dimension: owner_type { type: string sql: ${TABLE}.owner_type ;; description: "Type of Owner" } measure: count_owners { label: "Number of Owners" type: count_distinct sql: ${TABLE}.owner_id ;; description: "Number of owners" } }