问题
The data that I need the quartiles is a query with the first column being the month-year and the second column being a count of defects for that month. I am looking to have the quartiles to be displayed on a report (Name: QE Quartile Test).
Query name: QE Test Count Step 2 Columns names: ProductionYM ; Claims
The following code is something I found online but I don't code much so I don't know where to go from here.
Public Function XPercentile()
XPercentile = DMin(Claims, QETest, "DCount(""*"", """ & QETest & """, """ & Claims & "<="" & [" & Claims & " ]) >= " & 0.5 * DCount("*", QETest))
End Function
I am aware that excel has all the functions to do this but I was requested to get this to work in access.
回答1:
You can find that here on GitHub: VBA.Quartiles
Calculate quartiles in 20 ways and medians in Microsoft Access
Code is way to much to post here, but included is also a link to the full documentation:
20 Varieties of Quartiles
(if you don't have an account, browse for the link: Read the full article)
来源:https://stackoverflow.com/questions/60552925/access-25-50-75-quartiles-data-from-query-and-result-destination-is-a-repo