-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathvideo_annotation_facts.view.lkml
89 lines (76 loc) · 1.74 KB
/
video_annotation_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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
view: video_annotation_facts {
derived_table: {
sql:
SELECT
date
,video_id
, sum(annotation_impressions) as impressions
, sum(annotation_clickable_impressions) as clickable_impressions
, sum(annotation_clicks) as clicks
, sum(annotation_click_through_rate) as click_through_rate
, sum(annotation_closes) as closes
, sum(annotation_closable_impressions) as closable_impressions
, sum(annotation_close_rate) as close_rate
FROM `bigquery-connectors.youtube_channel_reports.channel_annotations_a1_ycr`
group by 1, 2
;;
}
dimension: date {
hidden: yes
type: string
sql: ${TABLE}.date ;;
}
dimension: video_id {
hidden: yes
type: string
sql: ${TABLE}.video_id ;;
}
dimension: primary_key {
type: string
primary_key: yes
hidden: yes
sql: concat(${date}, ${video_id}) ;;
}
measure: impressions {
type: sum
sql: ${TABLE}.impressions ;;
}
measure: clickable_impressions {
type: sum
sql: ${TABLE}.clickable_impressions ;;
}
measure: clicks {
type: sum
sql: ${TABLE}.clicks ;;
}
measure: click_through_rate {
type: number
sql: 1.0 * ${clicks}/nullif(${clickable_impressions}, 0) ;;
value_format_name: percent_1
}
measure: closes {
type: sum
sql: ${TABLE}.closes ;;
}
measure: closable_impressions {
type: sum
sql: ${TABLE}.closable_impressions ;;
}
measure: close_rate {
type: number
sql: 1.0 * ${closes}/nullif(${closable_impressions}, 0) ;;
value_format_name: percent_1
}
set: detail {
fields: [
date,
video_id,
impressions,
clickable_impressions,
clicks,
click_through_rate,
closes,
close_rate
]
}
}