revenue_from_project_usage_daily
diff --git a/views/revenue/revenue_from_project_usage_daily.view.lkml b/views/revenue/revenue_from_project_usage_daily.view.lkml new file mode 100644 index 0000000..9dda8f7 --- /dev/null +++ b/views/revenue/revenue_from_project_usage_daily.view.lkml
@@ -0,0 +1,135 @@ +######################################################## +# +# Author: hillz@ +# Updated Date: December 7, 2021 +# Fields related to "Project Usage" from the project_usage_daily +# table. If these fields are selected, Looker will switch to +# using the project_usage_daily table instead of revenue. +# +######################################################## +view: revenue_from_project_usage_daily { + extension: required + #### DIMENSIONS #### + dimension: project_id { + view_label: "Project/SKU" + description: "Project ID for GCP Usage, maps to Project Number. Selecting this field will make your query much slower." + type: string + sql: ${TABLE}.project_id ;; + full_suggestions: yes + link: { + label: "Project Lookup" + url: "/dashboards-next/143?Project%20ID={{filterable_value}}&Product%20Group={{_filters['revenue.product_group']}}&Account%20Name={{_filters['vector_customers.account_name']}}&NAL%20Name={{_filters['revenue.nal_name']}}&Project%20Name={{_filters['revenue.project_name']}}" + icon_url: "https://www.google.com/s2/favicons?domain=www.looker.com" + } + } + dimension: project_name { + view_label: "Project/SKU" + description: "Project name for GCP usage, can change over time. For a static value, use Project ID. Selecting this field will make your query much slower." + sql: ${TABLE}.project_name ;; + type: string + full_suggestions: yes + } + dimension: project_number { + view_label: "Project/SKU" + description: "Project number for GCP usage. Selecting this field will make your query much slower." + sql: ${TABLE}.project_number ;; + type: string + } + dimension: resource_group { + view_label: "Project/SKU" + description: "Resource group collects various SKUs. Selecting this field will make your query much slower." + sql: ${TABLE}.resource_group ;; + type: string + } + dimension: sku_description { + label: "SKU Description" + group_label: "SKU" + view_label: "Project/SKU" + description: "Human-readable identifier for each product at the SKU level. Selecting this field will make your query much slower." + sql: ${TABLE}.sku_description ;; + type: string + } + dimension: sku_id { + label: "SKU ID" + group_label: "SKU" + view_label: "Project/SKU" + description: "Unique identifier for each product at the SKU level. Selecting this field will make your query much slower." + sql: ${TABLE}.sku_id ;; + type: string + } + dimension: usage_in_usage_units_dim { + hidden: yes + sql: ${TABLE}.usage_in_usage_units ;; + type: number + } + dimension: usage_location { + view_label: "Project/SKU" + description: "Location of usage. Selecting this field will make your query much slower." + sql: ${TABLE}.usage_location ;; + type: string + } + dimension: usage_unit { + view_label: "Project/SKU" + description: "Unit for measuring SKU usage (i.e., GiBi, Second, etc.). Selecting this field will make your query much slower." + sql: ${TABLE}.usage_unit ;; + type: string + } + #### MEASURES #### + measure: usage_in_usage_units { + view_label: "Project/SKU" + sql: ${usage_in_usage_units_dim} ;; + type: sum + drill_fields: [billing_account_id, usage_unit, usage_in_usage_units] + value_format_name: decimal_0 + link: { + url: "{{ link | replace: \"billing_account_id\", \"product_line\" }}&limit=10" + label: "Top 10 Product Lines" + icon_url: "https://g3doc.corp.google.com/company/teams/concord/portal/images/logo-concord-no-text.png" + } + link: { + url: " + {% assign column_name = \"=\" | append: _view._name | append: \".billing_account_id\" %} + {{ link | replace: column_name, \"=revenue.nal_name,revenue.reporting_account_name\" }}&limit=10&sorts={{ _field._name }}+desc + " + label: "Top 10 Accounts" + icon_url: "https://g3doc.corp.google.com/company/teams/concord/portal/images/logo-concord-no-text.png" + } + link: { + url: " + {% assign column_name = \"=\" | append: _view._name | append: \".billing_account_id\" %} + {{ link | replace: column_name, \"=revenue.segment\" }}&limit=10&sorts={{ _field._name }}+desc + " + label: "Drill by Segment" + icon_url: "https://g3doc.corp.google.com/company/teams/concord/portal/images/logo-concord-no-text.png" + } + link: { + url: " + {% assign column_name = \"=\" | append: _view._name | append: \".billing_account_id\" %} + {{ link | replace: column_name, \"=revenue.account_category\" }}&limit=10&sorts={{ _field._name }}+desc + " + label: "Drill by Account Category" + icon_url: "https://g3doc.corp.google.com/company/teams/concord/portal/images/logo-concord-no-text.png" + } + link: { + url: " + {% assign column_name = \"=\" | append: _view._name | append: \".billing_account_id\" %} + {{ link | replace: column_name, \"=revenue.region\" }}&limit=10&sorts={{ _field._name }}+desc + " + label: "Drill by Region" + icon_url: "https://g3doc.corp.google.com/company/teams/concord/portal/images/logo-concord-no-text.png" + } + link: { + url: " + {% assign column_name = \"=\" | append: _view._name | append: \".billing_account_id\" %} + {{ link | replace: column_name, \"=revenue.region,revenue.sub_region,revenue.micro_region,revenue.nal_cluster,revenue.nal_name,revenue.nal_id\" }}&sorts={{ _field._name }}+desc + " + label: "Drill by NAL" + icon_url: "https://g3doc.corp.google.com/company/teams/concord/portal/images/logo-concord-no-text.png" + } + link: { + url: "{{ link | replace: \"billing_account_id\", \"product_group\" }}" + label: "Drill by Product Group" + icon_url: "https://g3doc.corp.google.com/company/teams/concord/portal/images/logo-concord-no-text.png" + } + } +}