Hello, I want to make a NPS calculation to use as...
# gooddata-platform
j
Hello, I want to make a NPS calculation to use as a metric - any recommendation on how to best set this up? Thanks!
m
Hi Josefin, May we know how does your NPS calculation look like currently and what data do you expect to get from the metric?
j
• Ratings range from "10 = Extremely Likely" to "0 = Not Likely At All" • 9-10 votes are called Promoters • 7-8 are called Passive • 0-6 votes are called Detractors NPS is calculated by comparing the percentage of Promoters to the percentage of Detractors: (# Promoters - # Detractors) / # Respondents.
Does that make sense or did I perhaps misunderstand the questions?
m
I believe your description is similar to what we described in our blog post here: https://www.gooddata.com/blog/net-promoter-score-data-explained/ In such case, your metric would look as follows:
Copy code
select ifnull( ((select count(Records of NPS Feedback)) where NPS Score>=9) / (select count(Records of NPS Feedback))),0) - (select ifnull( ((select count(Records of NPS Feedback) where NPS Score<=6) / (select count(Records of NPS Feedback))),0) )
You will just need to make sure you use your own variables. Let us know if this helps.
j
Perfect - thank you very much! :)
Hi again, I tried adjusting the code accordingly but seem to have gotten something wrong. In my dataset, I have a survey with responses. In the dataset "answers"very response belongs to a question, and every respondent has a respondent id. So the records of nps feedback is in a question with an id. I don't think I have an equivalent of "records of nps feedback". Do I need to create that or is it something else that's incorrect? Sending images of the LDM and how I tried to adjust the code. Thanks! :)
m
Hi Josefin, I can see the metric is not properly defined. Can you add one more ‘)’ after the last fact (‘Response’). Does it help?
j
Hi - is this how you meant? Or someplace else?