Calculate Z-Score

  • I know how to do this in Excel, does anyone know how to calculate Z-score in SQL? 

    I have all the columns that I need and all the calculations work perfectly, I just don't like doing the last step in Excel if I don't have to.

    My boss is a Stats guy which is fine by me, I am learning some new analysis tools, I just want to be able to do them in SQL and not Excel.

  • Try begin with STDEV and STDEVP functions and see what they do for you.

     

    An example of calculating z-score is

    zscore = (product category sales - product avg) / product stdev

    Meaning

    zscore = ( SUM(Product category) - AVG(Product)) / STDEV(Product) or

    zscore = ( COUNT(Product category) - AVG(Product)) / STDEV(Product)

     

    Good luck


    N 56°04'39.16"
    E 12°55'05.25"

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply