How to ignore nulls in average
Is there a way to ignore nulls when performing an average so those rows are not included in the aggregration?
I am returning Json data from an ajax call.
Thank you for the question.
Actually, it seems that
null‘s are ignored when calculating the average (see http://jsfiddle.net/flexmonster/bmszjju9/).
Please let me know if you have any other questions.
Thanks for this. However, if the first value is null, an aggregation cant be performed. Is there a way round this?
Yes, you can do this. Usually, first value used to determine the column type (i.e.
date , etc.).
So, if the first value is
null it will be determined by default as
string. Therefore, you should set column type explicitly.
Please refer to the updated sample – http://jsfiddle.net/flexmonster/bmszjju9/
Also, here is more documentation about JSON data styles.
Hope it helps.
Thanks. This worked