-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsemantic_models.json
More file actions
80 lines (80 loc) · 2.63 KB
/
semantic_models.json
File metadata and controls
80 lines (80 loc) · 2.63 KB
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
{
"semantic_models": {
"dm_employees": {
"name": "dm_employees",
"label": "Employees",
"description": "A table containing employee data.",
"dimensions": [
{
"name": "employee_pk",
"description": "The primary key of the employee.",
"data_type": "string"
}
],
"measures": []
},
"mv_historical_headcount": {
"name": "mv_historical_headcount",
"label": "Historical Headcount",
"description": "A table containing historical headcount data.",
"measures": [
{
"name": "age",
"label": "Age",
"description": "The age of the employee population.",
"data_type": "number",
"aggregation": "median",
"sql": "mv_historical_headcount.age"
},
{
"name": "average_headcount",
"label": "Average Headcount",
"description": "The average employee headcount in a given time period, calculated by summing the headcount of each day in the period and diving by the number of days.",
"data_type": "number",
"measure_type": "ratio",
"numerator": {
"name": "sum_of_headcount"
},
"denominator": {
"name": "number_of_days_in_period"
}
},
{
"name": "sum_of_headcount",
"label": "Sum of Headcount",
"description": "The number of employees at the beginning of the time period.",
"data_type": "number",
"aggregation": "sum",
"measure_type": "cumulative",
"sql": "COUNT(CASE WHEN mv_historical_headcount.included_in_headcount THEN mv_historical_headcount.employee_pk END)",
"partition_by": ["MIN(mv_historical_headcount.effective_date)"]
},
{
"name": "number_of_days_in_period",
"label": "Number of Days in Period",
"description": "The number of days in the period.",
"data_type": "number",
"aggregation": "count_distinct",
"sql": "mv_historical_headcount.effective_date"
}
],
"dimensions": [
{
"name": "employee_pk",
"description": "The primary key of the employee.",
"data_type": "string"
},
{
"name": "effective_date",
"description": "The effective date of the headcount.",
"data_type": "timestamp"
},
{
"name": "included_in_headcount",
"description": "Whether the employee was included in the headcount for the given effective date.",
"data_type": "boolean"
}
]
}
}
}