访问 25%、50%、75% 四分位数(来自查询和结果目标的数据是报表)

Access 25%, 50%, 75% Quartiles (Data From Query and Result Destination is a Report)

我需要四分位数的数据是一个查询,第一列是年月,第二列是该月的缺陷数。我希望在报告中显示四分位数(名称:QE 四分位数测试)。

查询名称:QE 测试计数步骤 2 列名称:ProductionYM;理赔

以下代码是我在网上找到的,但我的代码不多,所以我不知道从哪里开始。

Public Function XPercentile()
    XPercentile = DMin(Claims, QETest, "DCount(""*"", """ & QETest & """, """ & Claims & "<="" & [" & Claims & " ]) >= " & 0.5 * DCount("*", QETest))
End Function

我知道 excel 具有执行此操作的所有功能,但我被要求让它在访问中工作。

您可以在 GitHub 上找到:VBA.Quartiles

在 Microsoft Access 中以 20 种方式计算四分位数和中位数

这里的代码比 post 多了很多,但还包括 link 完整文档:

20 Varieties of Quartiles

(如果您没有帐户,请浏览 link:阅读全文)