Forum Discussion

aaron797's avatar
aaron797
Advocate I
6 years ago
Solved

Create Column Avg Group by

Hi,

 

We have a survey, with a set number of questions, each question is assigned a "camp" they belong to. 

A person can be considered engaged in a camp if the average of their answers for the questions (for that camp) is greater than or equal to 3.

I am needing to get a measure that will tell me the number of engaged employees for each camp.

 

My approach would be to create a column, which is the average of answer, grouped by camp and ID, return IF AVG(ianswer) is >= 3," Engaged", else "Disengaged". However i am struggling with the correct syntax.

 

Currently, my data set looks like this,

UserIDQuestionIDCampAnswer
1113
1214
1322
1424
2114
2214
2322
2421

 

My desired output is 

UserIDQuestionIDCampAnswerCamp Engaged
1113Engaged
1214Engaged
1322Engaged
1424Engaged
2114Engaged
2214Engaged
2323Disengaged
2421Disengaged

 

Would appreciate any tips for this!

2 Replies