-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathvideo_playlist_facts.view.lkml
68 lines (59 loc) · 1.2 KB
/
video_playlist_facts.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
view: video_playlist_facts {
derived_table: {
sql: SELECT date, video_id, playlist_id
, sum(playlist_starts) as starts
, sum(playlist_saves_added) as saves_added
, sum(playlist_saves_removed) as saves_removed
, sum(views) as views
FROM `bigquery-connectors.youtube_channel_reports.p_playlist_basic_a1_ycr`
group by 1, 2, 3
;;
}
dimension: primary_key {
hidden: yes
primary_key: yes
type: string
sql: concat(${date}, ${video_id}, ${playlist_id}) ;;
}
dimension: date {
hidden: yes
type: string
sql: ${TABLE}.date ;;
}
dimension: video_id {
hidden: yes
type: string
sql: ${TABLE}.video_id ;;
}
dimension: playlist_id {
type: string
sql: ${TABLE}.playlist_id ;;
}
measure: starts {
type: sum
sql: ${TABLE}.starts ;;
}
measure: saves_added {
type: sum
sql: ${TABLE}.saves_added ;;
}
measure: saves_removed {
type: sum
sql: ${TABLE}.saves_removed ;;
}
measure: views {
type: sum
sql: ${TABLE}.views ;;
}
set: detail {
fields: [
date,
video_id,
playlist_id,
starts,
saves_added,
saves_removed,
views
]
}
}