How to use metrics correctly when the data source is Elasticsearch?

I want to find the sum of the values of a field from elasticsearch, but when the value of the column is null, it outputs zero, which is an incorrect value for me, I want to display the same null value.