-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmaestroqa.model.lkml
167 lines (144 loc) · 5.03 KB
/
maestroqa.model.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
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
# # This explore is intended to be JUST the MaestroQA generated data
# # For integration with a helpdesk block, see the documentation titled
# # 'helpdesk_integration' (warning: some dev experience probably required)
connection: "your_connection_here" # Replace with your connection name
# include all the views that maestroqa uses
include: "maestroqa.*.view"
# DON'T INCLUDE ANY DASHBOARDS HERE
# ALL DASHBOARDS ARE INCLUDED IN THE maestroqa_helpdesk_hybrid
explore: templates {
label: "Rubric Templates"
view_name: templates
from: templates
join: sections {
from: sections
type: left_outer
relationship: one_to_many
sql_on: ${templates.template_id} = ${sections.template_id} ;;
}
join: questions {
type: left_outer
relationship: one_to_many
sql_on: ${templates.template_id} = ${questions.template_id} and
${sections.section_id} = ${questions.section_id};;
}
join: custom_options {
type: left_outer
relationship: one_to_many
sql_on: ${templates.template_id} = ${custom_options.template_id} and
${sections.section_id} = ${custom_options.section_id} and
${questions.question_id} = ${custom_options.question_id};;
}
join: feedback_options {
type: left_outer
relationship: one_to_many
sql_on: ${templates.template_id} = ${feedback_options.template_id} and
${sections.section_id} = ${feedback_options.section_id} and
${questions.question_id} = ${feedback_options.question_id};;
}
join: answers {
type: left_outer
relationship: one_to_many
sql_on: ${templates.template_id} = ${answers.template_id} ;;
}
}
explore: rubric_answers {
label: "Rubric Answers"
view_name: answers
from: answers
join: templates {
type: left_outer
relationship: many_to_one
sql_on: ${answers.template_id} = ${templates.template_id} ;;
}
## SECTION_SCORES + SECTIONS (sections only needed for section metadata)
join: section_scores {
type: left_outer
relationship: one_to_many
sql_on: ${answers.answer_id} = ${section_scores.answer_id} ;;
}
join: sections {
type: left_outer
relationship: one_to_many
sql_on: ${section_scores.template_id} = ${sections.template_id} and
${section_scores.section_id} = ${sections.section_id};;
fields: [name, weight, is_auto_fail, is_bonus]
}
join: questions {
type: left_outer
relationship: one_to_many
sql_on: ${answers.template_id} = ${questions.template_id} and
${sections.section_id} = ${questions.section_id} ;;
fields: [question, description, score_min, score_max, score_system]
}
join: question_scores {
type: left_outer
relationship: one_to_many
sql_on: ${answers.answer_id} = ${question_scores.answer_id} and
${questions.template_id} = ${question_scores.template_id} and
${questions.question_id} = ${question_scores.question_id};;
}
join: custom_options {
type: left_outer
relationship: one_to_many
sql_on: ${questions.template_id} = ${custom_options.template_id} and
${questions.question_id} = ${custom_options.question_id};;
}
join: option_selections {
type: left_outer
relationship: one_to_many
sql_on: ${questions.template_id} = ${option_selections.template_id} and
${question_scores.question_id} = ${option_selections.question_id} and
${custom_options.option_id} = ${option_selections.option_id};;
}
join: feedback_options {
type: left_outer
relationship: one_to_many
sql_on: ${questions.template_id} = ${feedback_options.template_id} and
${question_scores.question_id} = ${feedback_options.question_id};;
}
join: feedback_selections {
type: left_outer
relationship: one_to_many
sql_on: ${questions.template_id} = ${feedback_selections.template_id} and
${question_scores.question_id} = ${feedback_selections.question_id} and
${feedback_options.option_id} = ${feedback_selections.option_id};;
}
## ANNOTATIONS TO MAP ANSWER ID TO HIGHLIGHT
join: annotations {
type: left_outer
relationship: one_to_many
sql_on: ${answers.answer_id} = ${annotations.answer_id};;
fields: [annotation_type, highlight, feedback]
}
## HELPDESK ID EMAIL TO MAP GRADEE ID TO EMAIL
join: helpdesk_id_email {
type: left_outer
relationship: one_to_one
sql_on: ${answers.gradee_id} = ${helpdesk_id_email.helpdesk_id};;
fields: [email]
}
## GROUP NAME TO MAP GRADEE ID TO GROUP
join: user_groups {
type: left_outer
relationship: one_to_one
sql_on: ${answers.gradee_id} = ${user_groups.agent_id};;
fields: [group_name]
}
}
explore: appeals {
label: "Appeals"
view_name: appeals
from: appeals
join: appeal_comments {
type: left_outer
relationship: one_to_many
sql_on: ${appeals.appeal_id} = ${appeal_comments.appeal_id};;
}
join: appeal_answers {
type: left_outer
relationship: one_to_many
sql_on: ${appeals.appeal_id} = ${appeal_answers.appeal_id} and
${appeals.answer_id} = ${appeal_answers.answer_id};;
}
}