-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcriteria_base.view.lkml
167 lines (138 loc) · 3.08 KB
/
criteria_base.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
include: "ad_group.view"
include: "google_adwords_base.view"
explore: criteria_joins_base {
extension: required
hidden: yes
view_name: criteria
join: ad_group {
from: ad_group
view_label: "Ad Groups"
sql_on: ${criteria.ad_group_id} = ${ad_group.ad_group_id} AND
${criteria.campaign_id} = ${ad_group.campaign_id} AND
${criteria.external_customer_id} = ${ad_group.external_customer_id} AND
${criteria._date} = ${ad_group._date} ;;
relationship: many_to_one
}
join: campaign {
from: campaign
view_label: "Campaign"
sql_on: ${criteria.campaign_id} = ${campaign.campaign_id} AND
${criteria.external_customer_id} = ${campaign.external_customer_id} AND
${criteria._date} = ${campaign._date};;
relationship: many_to_one
}
join: customer {
from: customer
view_label: "Customer"
sql_on: ${criteria.external_customer_id} = ${customer.external_customer_id} AND
${criteria._date} = ${customer._date} ;;
relationship: many_to_one
}
}
view: criteria_base {
extension: required
extends: [google_adwords_base]
dimension: ad_group_id {
hidden: yes
}
dimension: base_ad_group_id {
hidden: yes
}
dimension: base_campaign_id {
hidden: yes
}
dimension: bid_modifier {
type: number
hidden: yes
}
dimension: bid_type {
hidden: yes
}
dimension: campaign_id {
hidden: yes
}
dimension: cpc_bid {
type: number
hidden: yes
}
dimension: cpc_bid_source {
type: string
hidden: yes
}
dimension: cpm_bid {
type: number
hidden: yes
}
dimension: cpm_bid_source {
hidden: yes
}
dimension: criteria {}
dimension: criteria_destination_url {
hidden: yes
}
dimension: criterion_id {
hidden: yes
sql: ${TABLE}.id ;;
}
dimension: final_app_urls {
hidden: yes
}
dimension: final_mobile_urls {
hidden: yes
}
dimension: final_urls {
hidden: yes
}
dimension: is_negative {
type: yesno
hidden: yes
}
dimension: is_restrict {
type: yesno
hidden: yes
}
dimension: status {
hidden: yes
}
dimension: status_active {
hidden: yes
type: yesno
sql: ${status} = "enabled" ;;
}
dimension: tracking_url_template {
hidden: yes
}
dimension: url_custom_parameters {
hidden: yes
}
dimension: key_base {
hidden: yes
sql: CONCAT(
CAST(${external_customer_id} AS STRING), "-",
CAST(${campaign_id} AS STRING), "-",
CAST(${ad_group_id} AS STRING), "-",
CAST(${criterion_id} AS STRING)) ;;
}
measure: count {
hidden: yes
type: count_distinct
sql: ${key_base} ;;
drill_fields: [drill_detail*]
}
measure: count_active {
hidden: yes
type: count_distinct
sql: ${key_base} ;;
filters: {
field: status_active
value: "Yes"
}
drill_fields: [drill_detail*]
}
set: drill_detail {
fields: [criterion_id, criteria, status, cpc_bid]
}
set: detail {
fields: [external_customer_id, campaign_id, ad_group_id, count, count_active, status_active, drill_detail*]
}
}