Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

NPS calculation

Hi all, first of all sorry if this is a very noob question but I'm with it two hours and I'm desperate.

I have a variable called NPS. I'm drawing a graph with the dimension Months and in the expression I want to add the NPS formula

(Count(NPS>8)-Count(NPS<7)/Count(NPS>=0))*100

The problem is that all the count provides me the same value that is the number of NPS values.

For example in January:

Count(NPS>8) = 1133

Count(NPS>0) = 1133

Count(NPS<7) = 1133

In NPS properties I have changed in the Number TAB the configuration to Integer.

Thanks in advance for your support.

Regards

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

NPS>8 will evaluate to -1 (true) or 0 (false). Both these values will be counted by Count(). If you want to use a condition inside your Count() you need to use

     Count( If(NPS>8,NPS,Null()) )

or

     Count( {$<NPS={">8"}>} NPS )

Long story short: Marcus' expression will work.

HIC

View solution in original post

4 Replies
marcus_sommer

Maybe so:

(count({< NPS = {">8"}>} NPS) - count({< NPS = {"<8"}>} NPS)) / count({< NPS = {">=0"}>} NPS) * 100

- Marcus

hic
Former Employee
Former Employee

NPS>8 will evaluate to -1 (true) or 0 (false). Both these values will be counted by Count(). If you want to use a condition inside your Count() you need to use

     Count( If(NPS>8,NPS,Null()) )

or

     Count( {$<NPS={">8"}>} NPS )

Long story short: Marcus' expression will work.

HIC

Not applicable
Author

Thanks very much for your answer for both the right answer and take your time for the explanation. I really appreciate your support.

Thanks and I hope to return the favor some day

Regards

Javi

MarcoWedel

-(Sum(NPS>8)+Sum(NPS<7)/Sum(NPS>=0))*100



might also work.


hope this helps


regards


Marco