This question is locked. New answers and comments are not allowed.
I have found that if I use a Count aggregate or an Average aggregate on a nullable column (the property I'm binding to in my model is a nullable decimal - decimal?) I get inconsistent results when there are nulls in the data. The Count includes all rows, even those that have null in the column value, but the Average excludes the nulls. So for example if I have four rows with the values 1, 8, null and 3, then the Count is 4, and the Average is 4 (12 divided by 3). I think the Average is correct and the Count is wrong, the Count should exclude nulls like the Average does. This would be consistent with SQL handling of nulls in aggregates.
I am managing to get the count excluding nulls now by dividing the Sum by the Average so please don't change the Average behavior because then there will be no way to get the count excluding nulls!
Sean
I am managing to get the count excluding nulls now by dividing the Sum by the Average so please don't change the Average behavior because then there will be no way to get the count excluding nulls!
Sean