Feb 26, 2021 02:49 PM
I’m trying to calculate and then visualize Net Promoter Score (NPS) from a table of evaluation scores submitted through a form.
NPS = (% promoters - % detractors) / total number respondents
Where:
promoter values = 9-10
detractor values = 1-6
total respondents = 1-10
I’m new to Vega and got stuck pretty quickly. I’m pretty sure I need to do a calculate transform step, but not sure how to assign e.g. “promoter” to values of 9 and 10. Is binning the approach, or is there some conditional logic that could work?
I’m interested in ways to do this without Vega as well, but I like not having to add extra fields to my table if it is possible to do the calculation within the app module.
Thanks in advance for any assistance!
Solved! Go to Solution.
Mar 04, 2021 06:29 AM
Figured it out. The key was to transform values [promoter, passive, detractor] into a score [+1, 0, -1] and use “joinaggregate” to create a sum_score that effectively equals the “promoters - detractors” bit of original equation. Rest was easy. Now to make it look pretty!
Mar 01, 2021 05:10 PM
Decided to add an extra field in Airtable that uses conditional logic to assign “promoter”, “detractor” and “passive” values when appropriate number in the “NPS” field.
Now just need to figure which are the appropriate transforms in Vega-lite (I think)
Mar 01, 2021 07:21 PM
I can probably help a little with this, but I’m totally slammed for the week.
Mar 02, 2021 11:58 AM
Thanks for the response, Bill! I’m going to continue to tinker with it when I get the time. Will post any updates to the thread.
Mar 04, 2021 06:29 AM
Figured it out. The key was to transform values [promoter, passive, detractor] into a score [+1, 0, -1] and use “joinaggregate” to create a sum_score that effectively equals the “promoters - detractors” bit of original equation. Rest was easy. Now to make it look pretty!