# How to calculate Net Promoter Score and display in Kibana?

**URL:** <https://discuss.elastic.co/t/how-to-calculate-net-promoter-score-and-display-in-kibana/51095>\
**Category:** Kibana\
**Created:** [May 26, 2016, 9:04pm UTC](https://discuss.elastic.co/t/how-to-calculate-net-promoter-score-and-display-in-kibana/51095 "2016-05-26T21:04:31Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![KibanaLover](https://avatars.discourse-cdn.com/v4/letter/k/edb3f5/32.png) [@KibanaLover](https://discuss.elastic.co/u/KibanaLover)\
**Post date:** [May 26, 2016, 9:04pm UTC](https://discuss.elastic.co/t/how-to-calculate-net-promoter-score-and-display-in-kibana/51095/1 "2016-05-26T21:04:31Z")

</div>

Is there a way I can calculate and display NPS in Kibana?

I can see that I can add scripted fields that allow me to manipulate the value from a single document field, but is there a way to display the result of a calculation based on the results from multiple queries? I have a feeling that this can only be done by building a Kibana plugin?

For example, if I have a field (call it score) can I calculate a result based on all scores from 3 queries:

I.e

Query 1 - Count all scores in date range  
Query 2 - Count all scores \> 8 in date range  
Query 3 - Count all scores \< 7 in date range

Display result of:

(query 2 \* 100 / query 1) - (query 3 \* 100 / query 1)

If this does require a plugin then let me know if you're available to write one for me!

Thanks.

---

<div class="post-metadata">

**Author:** ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)\
**Post date:** [May 27, 2016, 4:55pm UTC](https://discuss.elastic.co/t/how-to-calculate-net-promoter-score-and-display-in-kibana/51095/2 "2016-05-27T16:55:17Z")

</div>

We don't currently have a way to combine multiple queries together, so I can't think of a way to make this happen without writing a plugin.

There's a [plugin generator](https://github.com/elastic/generator-kibana-plugin) available to help you get started with that, if it's something you do want to take on.

---

<div class="post-metadata">

**Author:** ![KibanaLover](https://avatars.discourse-cdn.com/v4/letter/k/edb3f5/32.png) [@KibanaLover](https://discuss.elastic.co/u/KibanaLover)\
**Post date:** [May 28, 2016, 12:36pm UTC](https://discuss.elastic.co/t/how-to-calculate-net-promoter-score-and-display-in-kibana/51095/3 "2016-05-28T12:36:34Z")

</div>

Hi Joe,

Thanks for taking the time to respond.

I know my way around Ember but have no experience of Angular. I'm probably going to need to find a freelance dev to help. do you know anybody? It's a simple plugin so hopefully should not take much effort.

Regards,

Rob

---

<div class="post-metadata">

**Author:** ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)\
**Post date:** [May 31, 2016, 4:32pm UTC](https://discuss.elastic.co/t/how-to-calculate-net-promoter-score-and-display-in-kibana/51095/4 "2016-05-31T16:32:59Z")

</div>

If you were able to pick up Ember, you should also be able to pick up Angular. Between the generator and all the code in Kibana, you've got a ton of examples to work with, and the core devs, as well as some very experienced and helpful community members, are in the IRC channel (#kibana on freenode) to answer questions as well. Assuming you've got the time, of course.

---

<div class="post-metadata">

**Author:** ![KibanaLover](https://avatars.discourse-cdn.com/v4/letter/k/edb3f5/32.png) [@KibanaLover](https://discuss.elastic.co/u/KibanaLover)\
**Post date:** [June 1, 2016, 5:21pm UTC](https://discuss.elastic.co/t/how-to-calculate-net-promoter-score-and-display-in-kibana/51095/5 "2016-06-01T17:21:49Z")

</div>

Hi Joe,

Thanks again for responding.

Yes, time is the issue! I think I'm going to have to take the plunge though as there are quite a few changes that will be required to support the new functionality that I need.

Regards,

Rob

---

<div class="post-metadata">

**Author:** ![KibanaLover](https://avatars.discourse-cdn.com/v4/letter/k/edb3f5/32.png) [@KibanaLover](https://discuss.elastic.co/u/KibanaLover)\
**Post date:** [June 1, 2016, 8:03pm UTC](https://discuss.elastic.co/t/how-to-calculate-net-promoter-score-and-display-in-kibana/51095/6 "2016-06-01T20:03:40Z")

</div>

Hi Joe,

OK, tried to install kibana 4.2 and 4.3 dev environment (mac with node v0.12.7). Kibana starts without issue but I get a whole load of CSS errors - looks like less is not being compiled.

Is this similar to the issue you have raised here:

[https://github.com/elastic/kibana/issues/6885](https://github.com/elastic/kibana/issues/6885)

Any hints as to what I'm doing wrong? Can you recommend best forum to go to to get help with this?

Here's the first of many errors that I see:

`ERROR in ./src/ui/public/styles/dark-variables.less Module build failed: ModuleBuildError: Module build failed: URIError: URI malformed at decodeURIComponent (native) at /Users/rbennett/kibana/node_modules/autoprefixer-loader/node_modules/loader-utils/index.js:101:12 at Array.forEach (native) at Object.parseQuery (/Users/rbennett/kibana/node_modules/autoprefixer-loader/node_modules/loader-utils/index.js:78:12) at Object.module.exports (/Users/rbennett/kibana/node_modules/autoprefixer-loader/index.js:12:30) at DependenciesBlock.onModuleBuildFailed (/Users/rbennett/kibana/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:315:19) at nextLoader (/Users/rbennett/kibana/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:270:31) at /Users/rbennett/kibana/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:292:15 at runSyncOrAsync (/Users/rbennett/kibana/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:173:4) at nextLoader (/Users/rbennett/kibana/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:290:3) at /Users/rbennett/kibana/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:292:15 at context.callback (/Users/rbennett/kibana/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:148:14) at /Users/rbennett/kibana/node_modules/less-loader/index.js:80:3 at /Users/rbennett/kibana/node_modules/less/lib/less/render.js:35:17 at /Users/rbennett/kibana/node_modules/less/lib/less/parse.js:63:17 at Object.finish [as _finish] (/Users/rbennett/kibana/node_modules/less/lib/less/parser/parser.js:183:28) at Object.ImportVisitor._onSequencerEmpty (/Users/rbennett/kibana/node_modules/less/lib/less/visitors/import-visitor.js:35:14) at ImportSequencer.tryRun (/Users/rbennett/kibana/node_modules/less/lib/less/visitors/import-sequencer.js:50:14) at Object.ImportVisitor.run (/Users/rbennett/kibana/node_modules/less/lib/less/visitors/import-visitor.js:29:25) at Object.Parser.parse (/Users/rbennett/kibana/node_modules/less/lib/less/parser/parser.js:189:22) at Object.parse (/Users/rbennett/kibana/node_modules/less/lib/less/parse.js:61:18) @ ./optimize/bundles/kibana.entry.js 70:0-40`

---

<div class="post-metadata">

**Author:** ![JuanCarniglia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/juancarniglia/32/11154_2.png) [@JuanCarniglia](https://discuss.elastic.co/u/JuanCarniglia)\
**Post date:** [June 2, 2016, 2:55am UTC](https://discuss.elastic.co/t/how-to-calculate-net-promoter-score-and-display-in-kibana/51095/7 "2016-06-02T02:55:24Z")

</div>

You don't really need the dev environment, you can also build a new plugin and test it on a non-dwv setup.

Anyway, I could work on your plugin. I have developed a number of them (check [https://github.com/JuanCarniglia](https://github.com/JuanCarniglia) to see them).

Let me know

---

<div class="post-metadata">

**Author:** ![KibanaLover](https://avatars.discourse-cdn.com/v4/letter/k/edb3f5/32.png) [@KibanaLover](https://discuss.elastic.co/u/KibanaLover)\
**Post date:** [June 3, 2016, 9:46am UTC](https://discuss.elastic.co/t/how-to-calculate-net-promoter-score-and-display-in-kibana/51095/8 "2016-06-03T09:46:30Z")

</div>

Hi Juan,

Thanks - I've sent an email to your j\*\*\*\*\*\*\*\*\*\*\*i@gmail.com address as found on Github.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:51pm UTC](https://discuss.elastic.co/t/how-to-calculate-net-promoter-score-and-display-in-kibana/51095/9 "2017-07-06T13:51:36Z")

</div>

Closed on July 6, 2017, 1:51pm UTC


