-
Notifications
You must be signed in to change notification settings - Fork 0
/
measures_base.view.lookml
377 lines (296 loc) · 8.87 KB
/
measures_base.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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
- view: measures_base
sql_table_name: one.measures_base
fields:
- dimension: todate
type: time
timeframes: [date, month, year]
convert_tz: false
sql: ${TABLE}.todate
- dimension: data_source
type: string
sql: ${TABLE}.data_source
- dimension: eventtype
type: string
sql: ${TABLE}.eventtype
- dimension: age
type: int
sql: ${TABLE}.age
- dimension: gender
type: string
sql: ${TABLE}.gender
- dimension: organization_tenure
type: int
sql: ${TABLE}.tenure_months
- dimension: country
type: string
sql: ${TABLE}.country
- dimension: state
type: string
sql: ${TABLE}.state
- dimension: department
type: string
sql: ${TABLE}.department
- dimension: performance_rating
type: number
sql: ${TABLE}.performance_rating
- dimension: performance_rating_dim
type: string
sql: CAST(FLOOR(${TABLE}.performance_rating) as VARCHAR(50))
- dimension: prev_performance_rating
type: number
sql: ${TABLE}.prev_perf_rating
- dimension: prev_performance_rating_dim
type: string
sql: CAST(FLOOR(${TABLE}.prev_perf_rating) as VARCHAR(50))
- dimension: event_reason_id
type: string
sql: ${TABLE}.event_reason_id
- dimension: average_hc
type: number
sql: ${TABLE}.average_hc
- dimension: fte
type: number
sql: ${TABLE}.fte
- dimension: eom_hc
type: int
sql: ${TABLE}.eom_hc
- dimension: som_hc
type: int
sql: ${TABLE}.som_hc
- dimension: event_type
type: string
sql: ${TABLE}.event_type
- dimension: event_reason
type: string
sql: ${TABLE}.event_reason_id
- dimension: event_occurrence
type: int
sql: ${TABLE}.event_occurrence
- dimension: requisition_status
type: string
sql: ${TABLE}.req_status
- dimension: application_source
type: string
sql: ${TABLE}.application_source
- dimension: application_status
type: string
sql: ${TABLE}.application_status
- dimension: education_level
type: string
sql: ${TABLE}.educationlevel
- dimension: application_id
type: string
sql: ${TABLE}.applicationid
- dimension: candidate_id
type: string
sql: ${TABLE}.candidateid
- dimension: requisition_id
type: string
sql: ${TABLE}.reqid
- dimension: application_occurrence
type: int
sql: ${TABLE}.application_occurrence
- dimension: applications
type: string
sql: ${TABLE}.applications
- dimension: candidates
type: string
sql: ${TABLE}.candidates
- dimension: requisitions
type: string
sql: ${TABLE}.requisitions
- dimension: review_occurrence
type: int
sql: ${TABLE}.review_occurrence
- dimension: review_type
type: string
sql: ${TABLE}.review_type
- dimension: prev_perf_rating_same_review_type
type: number
sql: ${TABLE}.prev_perf_rating_same_review_type
- dimension: review_difference
type: number
sql: ${performance_rating} - ${prev_perf_rating_same_review_type}
### Headcount Section
- measure: average_headcount
type: sum
sql: ${average_hc}
- measure: end_of_month_headcount
type: sum
sql: ${eom_hc}
- measure: start_of_month_headcount
type: sum
sql: ${som_hc}
- measure: full_time_equivalent
type: sum
sql: ${fte}
- measure: eom_average_age
type: average
sql: ${age}
filters:
eom_hc: 1
- measure: eom_average_tenure
type: average
sql: 1.0 * ${organization_tenure} / 12
filters:
eom_hc: 1
- measure: eom_headcount_male
type: sum
sql: ${eom_hc}
filters:
gender: 1
- measure: eom_headcount_female
type: sum
sql: ${eom_hc}
filters:
gender: 2
- measure: eom_headcount_approaching_retirement_eligiblity
type: sum
sql: ${eom_hc}
filters:
age: '>42'
- measure: staffing_rate_approaching_retirement_eligiblity
type: number
sql: 100.00 * ${eom_headcount_approaching_retirement_eligiblity} / NULLIF(${end_of_month_headcount}, 0)
format: "%5.2f%%"
- measure: staffing_rate_male
type: number
sql: 100.00 * ${eom_headcount_male} / NULLIF(${end_of_month_headcount}, 0)
format: "%5.2f%%"
- measure: staffing_rate_female
type: number
sql: 100.00 * ${eom_headcount_female} / NULLIF(${end_of_month_headcount}, 0)
format: "%5.2f%%"
- measure: male_to_female_staffing_ratio
type: number
sql: 1.00 * ${eom_headcount_male} / NULLIF(${eom_headcount_female}, 0)
decimals: 2
### Mobility Section
- measure: hires
type: sum
sql: ${event_occurrence}
filters:
event_type: 'Hire'
- measure: hire_rate
type: number
sql: 100.00 * ${hires} / NULLIF(${average_headcount}, 0)
format: "%5.2f%%"
- measure: terminations
type: sum
sql: ${event_occurrence}
filters:
event_type: '%Termination%'
- measure: termination_rate
type: number
sql: 100.00 * ${terminations} / NULLIF(${average_headcount}, 0)
format: "%5.2f%%"
- measure: internal_movements
type: sum
sql: ${event_occurrence}
filters:
event_type: 'Transfer,Promotion,Demotion'
- measure: internal_movements_rate
type: number
sql: 100.00 * ${internal_movements} / NULLIF(${average_headcount}, 0)
format: "%5.2f%%"
- measure: promotions
type: sum
sql: ${event_occurrence}
filters:
event_type: 'Promotion'
- measure: promotion_rate
type: number
sql: 100.00 * ${promotions} / NULLIF(${average_headcount}, 0)
format: "%5.2f%%"
- measure: transfers
type: sum
sql: ${event_occurrence}
filters:
event_type: 'Transfer'
- measure: transfer_rate
type: number
sql: 100.00 * ${transfers} / NULLIF(${average_headcount}, 0)
format: "%5.2f%%"
- measure: demotions
type: sum
sql: ${event_occurrence}
filters:
event_type: 'Demotion'
- measure: demotion_rate
type: number
sql: 100.00 * ${demotions} / NULLIF(${average_headcount}, 0)
format: "%5.2f%%"
- measure: lateral_mobility
type: number
sql: 100.00 * ${transfers} / NULLIF(${internal_movements}, 0)
format: "%5.2f%%"
- measure: upward_mobility
type: number
sql: 100.00 * ${promotions} / NULLIF(${internal_movements}, 0)
format: "%5.2f%%"
- measure: downward_mobility
type: number
sql: 100.00 * ${demotions} / NULLIF(${internal_movements}, 0)
format: "%5.2f%%"
- measure: net_hire_ratio
type: number
sql: 1.00 * ${hires} / NULLIF(${terminations}, 0)
decimals: 2
## Recruitment Section
### Applications
- measure: application_occurrences
type: sum
sql: ${application_occurrence}
- measure: hires_staffing
type: sum
sql: ${application_occurrence}
filters:
application_status: 'Hired'
- measure: total_interviews
type: sum
sql: ${application_occurrence}
filters:
application_status: 'Interview'
- measure: offers_made
type: sum
sql: ${application_occurrence}
filters:
application_status: 'Offer'
- measure: offers_accepted
type: sum
sql: ${application_occurrence}
filters:
application_status: 'Offer Accepted'
- measure: offers_declined
type: sum
sql: ${application_occurrence}
filters:
application_status: 'Offer Rejected'
- measure: candidate_applied
type: sum
sql: ${application_occurrence}
filters:
application_status: 'Applied'
- measure: candidate_rejected
type: sum
sql: ${application_occurrence}
filters:
application_status: 'Rejected'
- measure: number_of_applications
type: count_distinct
sql: ${applications}
### Candidates
- measure: number_of_candidates
type: count_distinct
sql: ${candidates}
### Requisitions
- measure: number_of_requisitions
type: count_distinct
sql: ${requisitions}
## Performance Section
- measure: review_occurrences
type: sum
sql: ${review_occurrence}
- measure: improved_poor_performers
type: sum
sql: CASE WHEN ${prev_perf_rating_same_review_type} < 3.0 AND ${performance_rating} >= 3.0 THEN 1 ELSE 0 END