view: ownership_delivery_order_contents { sql_table_name: ORCHARD_APP_REPORTING_V2.PROD_NR_OWNERSHIP_DELIVERY_NEIGHBOURING_RIGHTS_OWNERSHIP_DELIVERY.ORDER_CONTENTS ;; # ========================================================================= # 1. COMPOSITE PRIMARY KEY & COUPLING LINKS # ========================================================================= # Created to establish uniqueness across intersection rows natively inside Looker dimension: unique_order_content_id { primary_key: yes hidden: yes type: string sql: (${TABLE}.ORDER_ID || '-' || COALESCE(${TABLE}.SOUNDRECORDING_ID, 'UNKNOWN_REC')) ;; } dimension: order_id { type: number sql: ${TABLE}.ORDER_ID ;; label: "Order ID Link" description: "Foreign key joining directly up to ownership_delivery_orders.id." } dimension: soundrecording_id { type: string sql: ${TABLE}.SOUNDRECORDING_ID ;; label: "Sound Recording ID Link" description: "Foreign key bridging out to your master Sound Recording Content spoken catalog view." } # ========================================================================= # 2. SYSTEM METADATA TIMESTAMPS (Hidden) # ========================================================================= dimension: _fivetran_deleted { type: yesno sql: ${TABLE}._FIVETRAN_DELETED ;; group_label: "System Metadata" hidden: yes } dimension_group: _fivetran_synced { type: time timeframes: [raw, date] datatype: timestamp sql: ${TABLE}._FIVETRAN_SYNCED ;; group_label: "System Metadata" hidden: yes } # ========================================================================= # 3. MEASURES # ========================================================================= measure: line_item_count { type: count description: "The total number of distinct recording line allocations packed into delivery orders." } }