forked from looker/block-gcp-billing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gcp_billing_export_service_core.view.lkml
50 lines (39 loc) · 1.29 KB
/
gcp_billing_export_service_core.view.lkml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
include: "//@{CONFIG_PROJECT_NAME}/gcp_billing_export.view"
view: gcp_billing_export_service {
extends: [gcp_billing_export_service_config]
}
view: gcp_billing_export_service_core {
### Field description reference https://cloud.google.com/billing/docs/how-to/export-data-bigquery
### DIMENSIONS
dimension: id {
description: "The ID of the service that the usage is associated with."
hidden: yes
type: string
sql: ${TABLE}.id ;;
}
dimension: description {
label: "Service"
description: "The Google Cloud Platform service that reported the billing data."
type: string
sql: ${TABLE}.description ;;
full_suggestions: yes
drill_fields: [gcp_billing_export_project.name, gcp_billing_export.sku_category, gcp_billing_export_sku.description]
}
### For one-vs-many project tiles on billing_by_project dashboard
filter: service_comparison {
type: string
}
dimension: service_compare {
type: yesno
sql: {% condition service_comparison %} ${description} {% endcondition %} ;;
}
### MEASURES
measure: service_filter { #Made for single value visualization
type: string
sql: {% if description._is_filtered %}
STRING_AGG(DISTINCT ${description}, ", ")
{% else %}
ANY_VALUE("All Services")
{% endif %};;
}
}