view: ownership_delivery_orders { sql_table_name: ORCHARD_APP_REPORTING_V2.PROD_NR_OWNERSHIP_DELIVERY_NEIGHBOURING_RIGHTS_OWNERSHIP_DELIVERY.ORDERS ;; # ========================================================================= # 1. PRIMARY KEYS & CORE LINKS # ========================================================================= dimension: id { primary_key: yes type: number sql: ${TABLE}.ID ;; label: "Order ID" description: "The primary unique immutable identifier for the master ownership delivery order." } dimension: cmm_id { type: number sql: ${TABLE}.CMM_ID ;; label: "Customer Master ID Link" description: "Foreign key used to join directly back to the global Customer Master view directory." } # ========================================================================= # 2. RAW OPERATIONAL FIELDS # ========================================================================= dimension: status { type: string sql: ${TABLE}.STATUS ;; group_label: "Order Details & Status" description: "The processing execution state status of the master delivery order." } dimension: territory { type: string sql: ${TABLE}.TERRITORY ;; group_label: "Order Details & Status" label: "Target Territory" description: "The geographic market region scope targeted by this ownership order request." } dimension: created_by { type: string sql: ${TABLE}.CREATED_BY ;; group_label: "Order Details & Status" description: "The system user identifier who generated this order tracking card." } dimension: cherry_pick_filename { type: string sql: ${TABLE}.CHERRY_PICK_FILENAME ;; group_label: "Order Details & Status" description: "The custom document filename assigned if specific tracks were cherry-picked for delivery." } dimension: v2 { type: yesno sql: ${TABLE}.V2 ;; group_label: "System Configuration Versions" label: "Is V2 Pipeline" description: "Flag identifying if this execution run passed through the version 2 modernization pipeline stack." } dimension: cmo_template_version { type: string sql: ${TABLE}.CMO_TEMPLATE_VERSION ;; group_label: "System Configuration Versions" label: "CMO Template Version" description: "The specific Collective Management Organization data layout scheme used for file construction." } # ========================================================================= # 3. VARIANT MESSAGE / SUMMARY METADATA # ========================================================================= dimension: message_raw { type: string sql: TO_VARCHAR(${TABLE}.MESSAGE) ;; group_label: "Order Text Payloads & JSON" label: "System Message Text" description: "Raw diagnostic summary JSON text or error tracking messaging strings." } dimension: summary_raw { type: string sql: TO_VARCHAR(${TABLE}.SUMMARY) ;; group_label: "Order Text Payloads & JSON" label: "Order Summary JSON" description: "Raw structural metadata content breakdown payload logs." } # ========================================================================= # 4. DATE / TIMESTAMPS # ========================================================================= dimension_group: created { type: time timeframes: [raw, time, date, week, month, quarter, year] datatype: timestamp sql: ${TABLE}.CREATED_AT ;; group_label: "Order Activity Windows" } dimension_group: last_updated { type: time timeframes: [raw, time, date, week, month, quarter, year] datatype: timestamp sql: ${TABLE}.LAST_UPDATED ;; group_label: "Order Activity Windows" } dimension_group: previous_delivered_order_created { type: time timeframes: [raw, date, month, year] datatype: timestamp sql: ${TABLE}.PREVIOUS_DELIVERED_ORDER_CREATED_AT ;; group_label: "Order Activity Windows" description: "Historical benchmark timestamp identifying when the preceding delivery pass was locked in." } # ========================================================================= # 5. 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 } # ========================================================================= # 6. MEASURES / METRIC AGGREGATIONS # ========================================================================= measure: order_count { type: count description: "The total number of registered ownership delivery master orders." } }