STDEVP in SQL
Posted on 2016-10-24
I have data that is arranged this way (see below) and need to calculate the Dispersion = Standard Deviation/Average of Total_NR rolled up by the MGR_NAME. How can I achieve this in T-SQL? Thank you.
The way it's supposed to work is: Sum (Total_NR) divided by the average of the sum of NR which we should then so a STDEVP on that average.
MGR_NAME EMPL HC Total_NR Avrg Dispersion?
JOSE PH 1027 1 $3,974.00 0.000107
JOSE PH 1233 1 $3,324.00 0.000074
JOSE PH 1354 1 $51.87 0.000012
JOSE PH 1375 1 $2,302.67 0.000049
JOSE PH 1486 1 $1,230.68 0.000045