Performance Analytics Weighted Survey Results with break down by user & group.

Justin Scheich
Tera Guru

I created this for our organization and did not see any guides on how to do so. I thought I would write up a guide to hopefully help someone else. 
This will take survey results, add a weight to each question, then calculate the average with breakdowns by user and group. 
Create a Survey and add the % each question should have out of 100 to the weight field.
Each question should have values 1-5
questionvalue.png

SurveyQ.png

Create an Indicator Source

IndicatorSource.png

Create an Indicator, set the aggregate to average, collect records, scripted True.

CSATIndicator.png

Add your Survey SYSID to the script below

var CATEGORY_ID = 'Survey SYSID';  //<- change to sysid of your survey
var instanceId = current.sys_id;
var total = 0;
var instanceCount = 0;
var average = 0;

var ga = new GlideAggregate('asmt_metric_result');
ga.addQuery('instance', instanceId);
ga.addQuery('metric.category', CATEGORY_ID);
ga.addQuery('weighted_value', '>', 0);
ga.groupBy('instance');
ga.addAggregate('SUM', 'weighted_value');
ga.query();

while (ga.next()) {
    total += parseFloat(ga.getAggregate('SUM', 'weighted_value')) || 0;
	instanceCount++;
	var average = instanceCount > 0 ? (total / instanceCount) : 0;
}

average;

Filter on only complete surveys
State FIlter.png
Collect breakdown matrix to true.
Collect breakdown matrix.png
Add breakdowns to the indicator for Assigned to & Assignment group.
Be sure to add the survey table to each break down
assignedtobreakdown.pngassignmentgroupbreakdown.png
Add jobs to run the indicator
indicator Jobs.png
This should give you a breakdown over time by person and group.

CSATAverage.pngbreakdown.png

0 REPLIES 0