Data is events with a date, username, company, score.
I want to calculate an NPS score by company.
detractors = scores 1-6
passive = score 7-8
promoters = score 9-10
Help would be highly appreciated.
It would help to know what you've tried so far, but perhaps this will help.
| eval detractor=if(score<7, 1, 0), promoter=if(score>8, 1, 0)
| stats count, sum(detractor) as detractors, sum(promoter) as promoters by company
| eval NPS = (promoters*100/count) - (detractors*100/count)
View solution in original post