-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathtickets.view.lookml
194 lines (156 loc) · 5.11 KB
/
tickets.view.lookml
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
- view: tickets
sql_table_name: looker_zendesk.tickets
fields:
- dimension: id
primary_key: true
type: number
sql: ${TABLE}.id
- dimension: assignee_email
description: the requester is the customer who initiated the ticket. the email is retrieved from the `users` table.
sql: ${assignees.email}
- dimension: assignee_id ## include only if your Zendesk application utilizes the assignee_id field
type: number
value_format_name: id
sql: ${TABLE}.assignee_id
# - dimension: brand_id ## include only if your Zendesk application utilizes the brand field
# value_format_name: id ## only associated with Zendesk Enterprise Accounts
# type: number
# sql: ${TABLE}.brand_id
- dimension_group: created_at
type: time
timeframes: [time, date, week, month]
sql: ${TABLE}.created_at::timestamp
- dimension: group_id
type: number
value_format_name: id
sql: ${TABLE}.group_id
- dimension: organization_id
type: number
value_format_name: id
sql: ${TABLE}.organization_id
- dimension: organization_name
type: string
sql: ${organizations.name}
- dimension: recipient
type: string
sql: ${TABLE}.recipient
- dimension: requester_email
description: the requester is the customer who initiated the ticket. the email is retrieved from the `users` table.
sql: ${requesters.email}
- dimension: requester_id
description: the requester is the customer who initiated the ticket
type: number
value_format_name: id
sql: ${TABLE}.requester_id
# - dimension: satisfaction_rating__comment
# type: string
# sql: ${TABLE}.satisfaction_rating__comment
#
# - dimension: satisfaction_rating__id
# type: number
# sql: ${TABLE}.satisfaction_rating__id
#
# - dimension: satisfaction_rating__score
# type: string
# sql: ${TABLE}.satisfaction_rating__score
- dimension: status
type: string
sql: ${TABLE}.status
- dimension: subject ## depending on use, either this field or "via_channel" will represent the channel the ticket came through
type: string
sql: ${TABLE}.subject
- dimension: submitter_id ## The submitter is always the first to comment on a ticket
description: a submitter is either a customer or an agent submitting on behalf of a customer
type: number
value_format_name: id
sql: ${TABLE}.submitter_id
- dimension: type
type: string
sql: ${TABLE}.type
- dimension: via__channel
type: string
sql: ${TABLE}.via__channel
- measure: count
type: count
drill_fields: [id, requester_email]
# ----- ADDITIONAL FIELDS -----
- dimension: is_backlogged
type: yesno
sql: ${status} = 'pending'
- dimension: is_new
type: yesno
sql: ${status} = 'new'
- dimension: is_open
type: yesno
sql: ${status} = 'open'
- dimension: is_solved
description: solved tickets have either a solved or closed status
type: yesno
sql: ${status} = 'solved' OR ${status} = 'closed'
- dimension: subject_category
sql: |
CASE
WHEN ${subject} LIKE 'Chat%' THEN 'Chat'
WHEN ${subject} LIKE 'Offline message%' THEN 'Offline Message'
WHEN ${subject} LIKE 'Phone%' THEN 'Phone Call'
ELSE 'Other'
END
- measure: count_pending_tickets
type: count
filters:
is_backlogged: 'Yes'
- measure: count_new_tickets
type: count
filters:
is_new: 'Yes'
- measure: count_open_tickets
type: count
filters:
is_open: 'Yes'
- measure: count_solved_tickets
type: count
filters:
is_solved: 'Yes'
- measure: count_distinct_organizations
type: count_distinct
sql: ${organization_id}
- measure: count_orgs_submitting
type: count_distinct
sql: ${organizations.name}
filters:
organization_name: "-NULL"
############ TIME FIELDS ###########
- dimension_group: time
type: time
timeframes: [day_of_week, hour_of_day] ### use day_of_week
sql: ${TABLE}.created_at::timestamp
# - dimension: created_day_of_week
# sql_case:
# Sunday: ${hidden_created_day_of_week_index} = 6
# Monday: ${hidden_created_day_of_week_index} = 0
# Tuesday: ${hidden_created_day_of_week_index} = 1
# Wednesday: ${hidden_created_day_of_week_index} = 2
# Thursday: ${hidden_created_day_of_week_index} = 3
# Friday: ${hidden_created_day_of_week_index} = 4
# Saturday: ${hidden_created_day_of_week_index} = 5
### REVIEW
# - dimension: satisfaction_rating_percent_tier
# type: tier
# tiers: [10,20,30,40,50,60,70,80,90]
# sql: ${satisfaction_rating}
#
# - measure: average_satisfaction_rating
# type: avg
# sql: ${satisfaction_rating}
# value_format: '#,#00.00%'
### REVIEW BELOW
# ----- Sets of fields for drilling ------
# sets:
# detail:
# - via__source__from__ticket_id
# - via__source__from__name
# - via__source__to__name
# - organizations.id
# - organizations.name
# - audits.count
# - zendesk_ticket_metrics.count