# Query sem dados

**URL:** <https://discuss.elastic.co/t/query-sem-dados/272017>\
**Category:** Kibana\
**Tags:** canvas\
**Created:** [May 3, 2021, 6:28pm UTC](https://discuss.elastic.co/t/query-sem-dados/272017 "2021-05-03T18:28:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![francieliton\_araujo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/francieliton_araujo/32/47771_2.png) [@francieliton\_araujo](https://discuss.elastic.co/u/francieliton_araujo)\
**Post date:** [May 3, 2021, 6:28pm UTC](https://discuss.elastic.co/t/query-sem-dados/272017/1 "2021-05-03T18:28:46Z")

</div>

Is there a way to do some elasticquery and if it didn't work, it returns something default?

---

<div class="post-metadata">

**Author:** ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)\
**Post date:** [May 4, 2021, 8:32pm UTC](https://discuss.elastic.co/t/query-sem-dados/272017/2 "2021-05-04T20:32:10Z")

</div>

I'm not totally sure what you mean. Which product are you using? Are you wanting to do a custom Elasticsearch query?

---

<div class="post-metadata">

**Author:** ![francieliton\_araujo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/francieliton_araujo/32/47771_2.png) [@francieliton\_araujo](https://discuss.elastic.co/u/francieliton_araujo)\
**Post date:** [May 5, 2021, 11:52am UTC](https://discuss.elastic.co/t/query-sem-dados/272017/3 "2021-05-05T11:52:21Z")

</div>

I will give an example

```auto
SELECT p1,p2,p3 FROM "teste-2021.3*" 

```

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/a/8a67466ff694a3585365ca61c6361be14a78c729.png)

if this happens i would like to have some standard data type: p1 = 0, p2 = 0 and p3 = 0, but as there is no data, even if I do this in the query itself with 'case' it does not solve

---

<div class="post-metadata">

**Author:** ![Felix\_Roessel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felix_roessel/32/41623_2.png) [@Felix\_Roessel](https://discuss.elastic.co/u/Felix_Roessel)\
**Post date:** [May 5, 2021, 2:25pm UTC](https://discuss.elastic.co/t/query-sem-dados/272017/4 "2021-05-05T14:25:50Z")

</div>

You should check the rowcount after receiving the data. If it is 0 set the defaults.  
This example shows how to do it

> **[APM Services overview canvas dashboard at elastic content share](https://elastic-content-share.eu/downloads/apm-services-overview-canvas/)**
>
> The APM services canvas is an adaptive canvas board that fits to your APM data. If you running Elastic APM -- try it for free!

---

<div class="post-metadata">

**Author:** ![francieliton\_araujo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/francieliton_araujo/32/47771_2.png) [@francieliton\_araujo](https://discuss.elastic.co/u/francieliton_araujo)\
**Post date:** [May 5, 2021, 6:35pm UTC](https://discuss.elastic.co/t/query-sem-dados/272017/5 "2021-05-05T18:35:54Z")

</div>

Thanks, I'm checking, and I already realized that he still brings information even without outputs, however I am very new in elastic and I still couldn't, please if possible I could make an example on top of the one I sent.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 2, 2021, 6:36pm UTC](https://discuss.elastic.co/t/query-sem-dados/272017/6 "2021-06-02T18:36:27Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
