nal
diff --git a/explores/nal.view.lkml b/explores/nal.view.lkml new file mode 100644 index 0000000..db13c4e --- /dev/null +++ b/explores/nal.view.lkml
@@ -0,0 +1,8 @@ +include: "/views/nal.view.lkml" +# Last Updated: March 2022 +# Created by: paoalrenteria@ +# Purpose: Defines a NAL Explore to be used to improve query performance for filter suggestions +explore: nal { + hidden: yes + description: "Surfaces NAL table data and is used explicitly for filter suggestions" +}
diff --git a/explores/vector_customers.view.lkml b/explores/vector_customers.view.lkml index 78626d3..ed5bbcf 100644 --- a/explores/vector_customers.view.lkml +++ b/explores/vector_customers.view.lkml
@@ -1,17 +1,17 @@ include: "/views/vector/customers.view.lkml" -# include: "/views/nal.view.lkml" +include: "/views/nal.view.lkml" # include: "/views/revenue/account_sort.view.lkml" # include: "/views/account_stats.view.lkml" # include: "/views/apac_account_metadata.view.lkml" explore: vector_customers { view_label: "Account" description: "Contains data on vector customers sourced from Vector, Anaplan and MDM" - # join: nal { - # view_label: "Account" - # sql_on: ${vector_customers.nal_id} = ${nal.nal_id} ;; - # type: left_outer - # relationship: many_to_one - # } + join: nal { + view_label: "Account" + sql_on: ${vector_customers.nal_id} = ${nal.nal_id} ;; + type: left_outer + relationship: many_to_one + } # join: account_sort { # type: left_outer # sql: ${vector_customers.reporting_id} = ${account_sort.reporting_id} ;;
diff --git a/views/nal.view.lkml b/views/nal.view.lkml new file mode 100644 index 0000000..0734ce3 --- /dev/null +++ b/views/nal.view.lkml
@@ -0,0 +1,121 @@ +######################################################## +# +# Author: paolarenteria@ +# Updated Date: 2021-12-10 +# Imports the nals_view table for NAL metadata +# +######################################################## +view: nal { + # sql_table_name: `concord-prod.service_gcc.nals_view` ;; + derived_table: { + sql: SELECT + 1 nal_id + , false is_dn_nal + , 'field_rep' field_rep + , 'access_key_hierarchy' access_key_hierarchy + , 'fsr_manager' fsr_manager + , false is_digital_native + , 'nal_sub_cluster' nal_sub_cluster + , 'nal_tag' nal_tag + , false is_street_level_nal + , 'micro_region' micro_region + , 'nal_cluster' nal_cluster + , 'nal_name' nal_name + , 'nal_type' nal_type + , 'nal_vertical' nal_vertical + , 'region' region + , 'sub_region' sub_region;; + } + + ##### PRIMARY KEY ##### + dimension: nal_id { + label: "NAL ID" + hidden: yes + primary_key: yes + type: number + sql: ${TABLE}.nal_id ;; + } + ##### DIMENSIONS ##### + dimension: digital_native { + group_label: "NAL Details" + label: "Digital Native" + description: "A string version of \"Is Digital Native NAL\" that is Digital Native or Traditional" + type: string + sql: IF(${is_dn_nal}, "Digital Native", "Traditional") ;; + } + dimension: field_rep { + group_label: "NAL People" + description: "LDAP of the Field Rep" + type: string + sql: ${TABLE}.field_rep ;; + link: { + label: "MOMA" + url: "https://moma.corp.google.com/person/{{ value }}" + } + } + dimension: field_rep_manager { + group_label: "NAL People" + description: "LDAP of the Field Rep's Manager" + type: string + sql: ${TABLE}.fsr_manager ;; + link: { + label: "MOMA" + url: "https://moma.corp.google.com/person/{{ value }}" + } + } + dimension: is_dn_nal { + group_label: "NAL Details" + label: "Is Digital Native NAL" + type: yesno + sql: ${TABLE}.is_digital_native ;; + } + dimension: is_prime_nal { + group_label: "NAL Details" + label: "Is Prime NAL" + type: yesno + sql: ${TABLE}.nal_tag = "Prime" ;; + } + dimension: is_street_level_nal { + group_label: "NAL Details" + label: "Is Street Level NAL" + type: yesno + sql: ${TABLE}.is_street_level_nal ;; + } + dimension: micro_region { + description: "Micro region" + hidden: yes + sql: ${TABLE}.micro_region ;; + } + dimension: nal_cluster { + description: "NAL cluster" + hidden: yes + sql: ${TABLE}.nal_cluster ;; + } + dimension: nal_name { + description: "NAL name" + hidden: yes + sql: ${TABLE}.nal_name ;; + } + dimension: nal_segment { + group_label: "{% if _explore._name == 'gcp_forecast_quotas_transformed' %}Region{% else %}NAL Details{% endif %}" + label: "NAL Segment" + type: string + sql: ${TABLE}.nal_type ;; + } + dimension: nal_vertical { + group_label: "NAL Details" + label: "NAL Vertical" + type: string + sql: ${TABLE}.nal_vertical ;; + } + dimension: region { + description: "NAL region" + hidden: yes + sql: ${TABLE}.region ;; + } + dimension: sub_region { + description: "NAL sub region" + hidden: yes + sql: ${TABLE}.sub_region ;; + } +}