How to Add a Net Promoter Score (NPS) to a Table

You can get a net promoter score in a table, but the restriction is you will NOTbe able to do significance testing.

A Net Promoter Score is usually defined as a calculation of assigning a positive value (1) to cases that have given a positive rating and a negative value (-1) to cases that have given a negative rating.

In the example below, a positive rating of 9 or 10 is being assigned as a positive promoter and anyone with a value of 1 to 5 is being assigned as a negative promoter.

The way to get the net promoter score is to use the select_values function and assign a value of 1 to the promoters and a value of -1 to the detractors.

For Example:

Stub=:promotersneutraldetractorsnet promoters }Row=: [101.2#9,10/6=8/1-5] with Select([101.2#9,10/1-5],Vals(1,-1))

NOTE: You would not be able to do significance testing on this table because of the use of the Select function. You can write the row definition using the $[-dostat] command which would allow you to test the other rows in the table, but you can never do significance testing on the net promoters row.

Write the row like this to preserve the significance testing on the rest of the table.

Row=: [101.2#9,10/6=8/1-5] $[-Dostat] Select([101.2#9,10/1-5],Vals(1,-1))

If the net promoter row was in the middle of the table, you can turn the significance testing back on by using the $[dostat] command after it.

This might look something like this:

Row=: [101.2#9,10/6=8/1-5] $[-Dostat] Select([101.2#9,10/1-5],Vals(1,-1)) $[Dostat] [102.2#1//10]