Calculating skewness of a data distribution in SQL in Access without an additional subquery

こ雲淡風輕ζ 提交于 2019-12-12 03:34:23

问题


I have a dataset in an Access database that, for simplicity's sake, looks like this:

      ID     Group   Employee       Ticket ID
    ------ --------- -------- -----------------
      1        A       Joe           123414
      2        A       Joe           12309124
      3        A       Bob           112321321
      4        A       Bob           213123214142
      5        A       Sam           123214214124
      6        B       Jen           412949218419
      7        B       Amy           12341234213

What I'm trying to do is calculate the statistical skewness of distribution of the number of tickets each employee has handled.

In a perfect world, my SQL would be this:

SELECT
    [Group], SKEW([myCount]) AS mySkew
FROM
    (
     SELECT [Group], [Employee], COUNT(*) AS myCount
     FROM MyTable
     GROUP BY [Group], [Employee]
    )
        AS TempTable
GROUP BY
   [Group];

However, it appears that Access does not have a SKEW function. Anyone know how I can do this calculation?


回答1:


It looks like somebody has tried this and created a small library for it here:

http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_2529-Median-Mode-Skewness-and-Kurtosis-in-MS-Access.html



来源:https://stackoverflow.com/questions/13613873/calculating-skewness-of-a-data-distribution-in-sql-in-access-without-an-addition

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!