view: global_countries { sql_table_name: ORCHARD_APP_REPORTING_V2.ART_RELATIONS_PROD_ART_RELATIONS.COUNTRY ;; # ========================================================================= # 1. PRIMARY KEYS & UNIQUE IDENTIFIERS # ========================================================================= dimension: country_code { primary_key: yes type: string sql: ${TABLE}."COUNTRY_CODE" ;; label: "Country Code (ISO 2)" description: "The 2-letter ISO country code used as the primary bridge link across platform datasets." } dimension: id { type: number sql: ${TABLE}."ID" ;; label: "Internal Country ID" description: "The unique sequential internal numeric identifier for the country record." } dimension: iso3166a3 { type: string sql: ${TABLE}."ISO3166A3" ;; group_label: "Country Geography Details" label: "Country Code (ISO 3)" description: "The standard 3-letter ISO country code identifier." } # ========================================================================= # 2. COUNTRY GEOGRAPHY DETAILS # ========================================================================= dimension: country_name { type: string sql: ${TABLE}."NAME" ;; group_label: "Country Geography Details" label: "Country Name" description: "The formal text name description of the country region." } dimension: abbrivation { type: string sql: ${TABLE}."ABBRIVATION" ;; group_label: "Country Geography Details" label: "Country Abbreviation" description: "The short-form localized text abbreviation tracking tag." } dimension: continent { type: string sql: ${TABLE}."CONTINENT" ;; group_label: "Country Geography Details" label: "Continent Name" description: "The text name description of the continent zone associated with the territory." } dimension: continent_id { type: number sql: ${TABLE}."CONTINENT_ID" ;; group_label: "Country Geography Details" label: "Continent ID Link" description: "The unique numeric identifier for the corresponding continent registry." } # ========================================================================= # 3. GEOSPATIAL COORDINATES (For Map Visualizations) # ========================================================================= dimension: latitude { type: number sql: ${TABLE}."LATITUDE" ;; group_label: "Geospatial Coordinates" description: "The geographic center-point latitude coordinate mapping factor value." } dimension: longitude { type: number sql: ${TABLE}."LONGITUDE" ;; group_label: "Geospatial Coordinates" description: "The geographic center-point longitude coordinate mapping factor value." } # Custom compound Looker location field to enable seamless point-map charts dimension: country_map_location { type: location sql_latitude: ${latitude} ;; sql_longitude: ${longitude} ;; group_label: "Geospatial Coordinates" label: "Country Map Location Pivot" description: "Unified Looker coordinate point enabling native map point visualization rendering." } # ========================================================================= # 4. SYSTEM METADATA TIMESTAMPS (Hidden to keep Explores pristine) # ========================================================================= 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 } # ========================================================================= # 5. MEASURES / AGGREGATIONS # ========================================================================= measure: unique_country_record_count { type: count description: "Total distinct count of geographical country entities mapped in the registry." } }