# Aggregation query returns empty result when one of the label match dont have the data

**URL:** <https://discuss.prometheus.io/t/aggregation-query-returns-empty-result-when-one-of-the-label-match-dont-have-the-data/3170>\
**Category:** PromQL\
**Created:** [October 22, 2024, 1:40pm UTC](https://discuss.prometheus.io/t/aggregation-query-returns-empty-result-when-one-of-the-label-match-dont-have-the-data/3170 "2024-10-22T13:40:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BrivinTech](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.prometheus.io/brivintech/32/964_2.png) [@BrivinTech](https://discuss.prometheus.io/u/BrivinTech)\
**Post date:** [October 22, 2024, 1:40pm UTC](https://discuss.prometheus.io/t/aggregation-query-returns-empty-result-when-one-of-the-label-match-dont-have-the-data/3170/1 "2024-10-22T13:40:38Z")

</div>

I have a lot of series of metrics in the prometheus server.

example, metric1 {name=“test”} 10 , metric2{name=“ex”} 15 and metric2{name=“ex2”} 20…

when i do the promQL like below

sum by (name) sum\_over\_time(metric1{name=“test”}) + sum by (name) sum\_over\_time(metric2{name=“ex”})

It returns 25 as expected.

but when i do the query like  
sum by (name) sum\_over\_time(metric1{name=“test”}) + sum by (name) sum\_over\_time(metric2{name=“notexists”})

It returns empty result instead of 10.

---

<div class="post-metadata">

**Author:** ![BrivinTech](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.prometheus.io/brivintech/32/964_2.png) [@BrivinTech](https://discuss.prometheus.io/u/BrivinTech)\
**Post date:** [October 22, 2024, 1:41pm UTC](https://discuss.prometheus.io/t/aggregation-query-returns-empty-result-when-one-of-the-label-match-dont-have-the-data/3170/2 "2024-10-22T13:41:54Z")

</div>

Please help on the correct query to achieve this. Is this an actual issue in the prometheus? Is it resolved or Are we tracking this by the PR or Bug id?.

Please help
