Hello - I am new to this forum. I hope I am posting in the right place.
I need help in eliminating outliers from a set of data. I started with creating a function to get the quartiles. The function is below (This code was originally written by Michael Walsh):
' Code courtesy of
' Michel Walsh
'
Public Function XPercentile(FName As String, _
TName As String, _
X As Double) _
As Double
' FName = Field name
' TName = Table name
' x = decimal percentile (0.68 for 68%)
' Return the minimum value for which x% of
' the values are lower or equal to it
XPercentile = DMin(FName, TName, _
"DCount(""*"", """ & TName & """, """ & FName & _
"<="" & [" & FName & " ]) >= " & _
X * DCount("*", TName))
End Function
' ***************Code start**************
And this is few rows of my access table:
Car Year Make Model Subseries Color Drs Price 2010 INFINITI G37 4X2 S WHITE 2 $10,600.00 2010 INFINITI G37 4X2 BASE LIQUID P 2 $10,800.00 2010 INFINITI G37 4X2 BASE LIQUID P 2 $12,800.00 2010 INFINITI G37 4X2 JOURNEY BLACK OB 2 $15,500.00 2010 INFINITI G37 4X2 JOURNEY BLACK OB 2 $15,800.00 2010 INFINITI G37 4X2 GRAPHITE 2 $16,000.00 2010 INFINITI G37 4X2 JOURNEY BLUE SLA 2 $17,000.00 2010 INFINITI G37 4X2 GREY 2 $17,300.00
I need to remove the outliers from the price column. First I keep getting an error with getting the lowest 25% records of the data. This is how I am entering the function:
Car Year Make Model Quartile: Xpercentile([Previous Sales]![Price],[Previous Sales],0.25) Previous Table Previous Table Previous Table Group By Group By Group By Expression checked checked checked checked
It keeps returning" you tried to execute a query....... as part of an aggregate function"
Could you please look into it?
Thank You,