view: performance_delivery_queue { sql_table_name: ORCHARD_APP_REPORTING_V2.PROD_PERFORMANCE_NR_DELIVERY_NEIGHBOURING_RIGHTS_DELIVERY.DELIVERY_QUEUE ;; # ========================================================================= # 1. COMPOSITE PRIMARY KEY & JOIN LINKS # ========================================================================= # No single primary key column exists on a queue log table, so we construct a unique Looker key dimension: unique_queue_id { primary_key: yes hidden: yes type: string sql: (${TABLE}.CONTRIBUTION_UUID || '-' || ${TABLE}.CONTRIBUTOR_UUID || '-' || ${TABLE}.CUSTOMER_MASTER_MASTER_ID) ;; } dimension: contribution_uuid { type: string sql: ${TABLE}.CONTRIBUTION_UUID ;; label: "Contribution UUID" description: "Foreign key mapping back to core content metadata." } dimension: contributor_uuid { type: string sql: ${TABLE}.CONTRIBUTOR_UUID ;; label: "Contributor UUID" description: "Foreign key mapping back to contributor directories." } dimension: customer_master_master_id { type: number sql: ${TABLE}.CUSTOMER_MASTER_MASTER_ID ;; label: "Customer Master ID Link" description: "Foreign key used to map back to global customer tracking names." } # ========================================================================= # 2. DATE / TIMESTAMPS # ========================================================================= dimension_group: created { type: time timeframes: [raw, time, date, week, month, quarter, year] datatype: timestamp sql: ${TABLE}.CREATED_AT ;; group_label: "Queue Process Logs" } dimension_group: last_updated { type: time timeframes: [raw, time, date, week, month, quarter, year] datatype: timestamp sql: ${TABLE}.LAST_UPDATED ;; group_label: "Queue Process Logs" } # ========================================================================= # 3. 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 } # ========================================================================= # 4. AGGREGATIONS / MEASURES # ========================================================================= measure: queue_record_count { type: count description: "Total number of items currently sitting inside or processed through the orchestration delivery queue." } }