Splunk Search

Calculate NPS (Net Promotor Score)

tzvikaz
Explorer

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

NPS=%promoters-%detractors

 

Help would be highly appreciated.

 

 

Labels (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

It would help to know what you've tried so far, but perhaps this will help.

<<your search>>
| 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)
---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

It would help to know what you've tried so far, but perhaps this will help.

<<your search>>
| 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)
---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Routing Data to Different Splunk Indexes in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. The OpenTelemetry project is the second largest ...

Getting Started with AIOps: Event Correlation Basics and Alert Storm Detection in ...

Getting Started with AIOps:Event Correlation Basics and Alert Storm Detection in Splunk IT Service ...

Register to Attend BSides SPL 2022 - It's all Happening October 18!

Join like-minded individuals for technical sessions on everything Splunk!  This is a community-led and run ...