This repository has been archived by the owner on Jan 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
account.view.lkml
96 lines (83 loc) · 1.86 KB
/
account.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
include: "fivetran_base.view"
explore: account_fb_adapter {
view_name: account
from: account_fb_adapter
hidden: yes
}
view: account_fb_adapter {
extends: [fivetran_base_fb_adapter, facebook_ads_config]
derived_table: {
sql:
(
SELECT account_history.* FROM `{{ account.facebook_ad_account_schema._sql }}.account_history` as account_history
INNER JOIN (
SELECT
id, max(_fivetran_synced) as max_fivetran_synced
FROM `{{ account.facebook_ad_account_schema._sql }}.account_history`
GROUP BY id) max_account_history
ON max_account_history.id = account_history.id
AND max_account_history.max_fivetran_synced = account_history._fivetran_synced
) ;;
}
dimension: id {
hidden: yes
sql: CAST(${TABLE}.id AS STRING) ;;
}
dimension: account_status {
hidden: yes
type: string
}
dimension: status_active {
hidden: yes
type: yesno
sql: ${account_status} = "ACTIVE" ;;
}
dimension_group: created {
hidden: yes
type: time
timeframes: [
raw,
time,
date,
week,
month,
quarter,
year
]
sql: ${TABLE}.created_time ;;
}
dimension: currency {
hidden: yes
type: string
sql: ${TABLE}.currency ;;
}
dimension: min_campaign_group_spend_cap {
hidden: yes
type: number
sql: ${TABLE}.min_campaign_group_spend_cap ;;
}
dimension: min_daily_budget {
hidden: yes
type: number
sql: ${TABLE}.min_daily_budget ;;
}
dimension: name {
hidden: yes
type: string
}
dimension: timezone_id {
hidden: yes
type: number
sql: ${TABLE}.timezone_id ;;
}
dimension: timezone_name {
hidden: yes
type: string
sql: ${TABLE}.timezone_name ;;
}
dimension: timezone_offset_hours_utc {
hidden: yes
type: number
sql: ${TABLE}.timezone_offset_hours_utc ;;
}
}