.nps()
Calculates a Net Promoter Score from a Sequence or List.
Net Promoter Score is calculated by taking the number of Promoters (values of 9 or 10), subtracting the number of Detractors (values of <= 6), and dividing by the total number. The result is multiplied by 100 and therefore will be between -100 (worst) and 100 (best).
This is especially useful in calculating eNPS (Employee Net Promoter Score).
Syntax
.nps()
- Returns the NPS score of items in the Sequence or List.
.nps{expression}
- Returns the NPS score of items in the Sequence or List evaluatingexpression for each item.
Examples
- [4, 8, 9, 10].nps() returns 25
- findAnswers('eNPS Question', '-30d').nps{it.value} returns the eNPS score from all of the responses to the eNPS Question question in the past 30 days.
- findAnswersByAssessment('eNPS Question', '2H Engagement Survey').groupBy{submitPerson.department}.nps{it.value} returns the eNPS score from all the answers to the eNPS Question in the 2H Engagement Survey, grouped by department.
