Create a calculation field like:
If ( AnalysisData::isOutlier ; "" ; AnalysisData::grammageCalculation )
Then do your statistical calculations on that field. Average and StDev ignore blank fields.
Yes, but I would like to have the statistical data in a separate table, and I have a calculation in there with such a statement.
So this will only work on the correct number of records within the same table?
You need the calc ( say it called "validResult" or whatever ) in the data table. That way if the record is an outlier, validResult will be blank otherwise it will contain the value ( grammage, maybe? ) you want to run your stat calcs on. Then perform Average, StDev on the "validResult" field.
However, this indeed does change the average, but it is not corrected for a reduced number of records to base the average on.
It isn't clear what you mean with that from the screenshot (which doesn't display any aggregated data); please provide an example.
If your found sets are not to large (>1000 records) you could try:
Use a script trigger or a "Calculate Now" button to create a new window (off screen). Loop through the records and omit the outliers. Use that new found set to calculate the stats and set regular numeric fields with the results (or just display them in a dialog box). Then close the off screen window.
It should be fast enough to not be noticable.
Thanks all for chiming in, there were some complicated relations involved and I had missed a few from some older unit tests that interfered with the calculation. Some more debugging and I should be able to get this working.