I got a sample code from the web, it run perfectly but I realised that my output result was not correct due to presence of a NULL value in a table, hence, I am asking for help on other method use for calculating Percentile if a field contain a null value / zero (0)
I had calculated already Avg, Median, Max but left with P75 and P25 Percentile. However some field (as shown above) already contain NULL value which does not allow the output to be acurate.
Truly the only thing to do is to exclude those rows for those calulations. You can't make them have a value of 0 without negatively impacting the calculation and invalidating the statistical validity.
"NOTHING is more important in a database than integrity." ESquared
Null means you do not know what the value is. So, if you do not know what a value is, how can you include it in any calculation?
The only way you can include it is if you have some business logic to say that if the value is unknown, set it to a particular value (and if that was the case, that should have been reflected in your database design).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.