# Visualizing sql query in Kibana

**URL:** https://discuss.elastic.co/t/visualizing-sql-query-in-kibana/310145
**Category:** Kibana
**Created:** [July 20, 2022, 12:22pm UTC](https://discuss.elastic.co/t/visualizing-sql-query-in-kibana/310145 "2022-07-20T12:22:16Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![random\_dash](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/random_dash/32/100548_2.png) [@random\_dash](https://discuss.elastic.co/u/random_dash)
#### Post date: [July 20, 2022, 12:22pm UTC](https://discuss.elastic.co/t/visualizing-sql-query-in-kibana/310145/1 "2022-07-20T12:22:16Z")

</div>

Hello!

I have some indices with following fields

```auto
status: ["Failed", "Succeeded", "None"]
user_id: user_id

```

I want to get events with status `None` if they are not in `Succeeded` set. This can be checked by `user_id`. So I need to collect all `user_id`s for `status=Succeeded` and check if the `user_id` of a `None` is not in that set. Similar to this sql query:

```auto
SELECT d FROM data d
WHERE d.status = 'None'
       AND d.user_id NOT IN (SELECT user_id FROM data WHERE status = 'Succeeded');

```

How can I achieve this by using advanced option (json inout) in the visualization? I need to do some visualization on this specific set. Is there any other way besides advanced option in Kibana?

---

<div class="post-metadata">

### Author: ![Stratoula\_Kalafateli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stratoula_kalafateli/32/70923_2.png) [@Stratoula\_Kalafateli](https://discuss.elastic.co/u/Stratoula_Kalafateli)
#### Post date: [July 21, 2022, 1:12pm UTC](https://discuss.elastic.co/t/visualizing-sql-query-in-kibana/310145/2 "2022-07-21T13:12:15Z")

</div>

Hey! It is not possible right now but we have it on our roadmap to support this kind of queries I saw that you created an enhancement request in our repo. Thanx for that!

---

<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: [August 18, 2022, 1:12pm UTC](https://discuss.elastic.co/t/visualizing-sql-query-in-kibana/310145/3 "2022-08-18T13:12:41Z")

</div>

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