Grafana singlestat issue

Hi,
I am trying to get the total count of all the input images received. I am using this query on singlestat sum(catalog_thirdparty_ingestion_service_total_input_image_count{environment=“staging”}) which is giving me an incorrect value while the graph properly shows exact point. I am using total as stat
Please suggest me a proper solution as this is making me confused

What do you see in the query inspector?

This is how the query looks like
{
“xhrStatus”: “complete”,
“request”: {
“method”: “GET”,
“url”: “api/datasources/proxy/4/api/v1/query_range?query=sum(catalog_thirdparty_ingestion_service_total_input_image_count%7Benvironment%3D%22staging%22%7D)&start=1560750040&end=1560751840&step=20”
},
“response”: {
“status”: “success”,
“data”: {
“resultType”: “matrix”,
“result”: [
{
“metric”: {},
“values”: [
[
1560751560,
“1”
],
[
1560751580,
“1”
],
[
1560751600,
“1”
],
[
1560751820,
“1”
],
[
1560751840,
“1”
]
]
}
]
}
}
}
Here the step count shows 20 for last 30 mins record when I change it to last 1 hour then step shows value 30 and count becomes less.
May I know the reason why the count becomes less with increase in time as it should be same or more than the previous value if we are increasing the time duration.

Show us the full query you are running

I am just running the following query
sum(catalog_thirdparty_ingestion_service_total_input_image_count{environment=“staging”})
which internally generates an internal query.
I just want to know how step affects count and please share the query where I am not concerned about the step and I just want to check the total count of messages elapsed over a particular interval.

Sorry, I am out of my comfort zone here. I will have to defer to another with more knowledge of how singlestat works.