# Kibana query filter by result of another saved search object field data

**URL:** https://discuss.elastic.co/t/kibana-query-filter-by-result-of-another-saved-search-object-field-data/266656
**Category:** Kibana
**Created:** [March 9, 2021, 8:04am UTC](https://discuss.elastic.co/t/kibana-query-filter-by-result-of-another-saved-search-object-field-data/266656 "2021-03-09T08:04:02Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![singyim817](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@singyim817](https://discuss.elastic.co/u/singyim817)
#### Post date: [March 9, 2021, 8:04am UTC](https://discuss.elastic.co/t/kibana-query-filter-by-result-of-another-saved-search-object-field-data/266656/1 "2021-03-09T08:04:02Z")

</div>

Hi,

I am migrating the log reports from direct search with oracle SQL to Kibana,

and I am creating the dashboard to show the existing log reports.

May I know is it possible to get the result like the following query and how can I do.

```auto
select profile, status, count (*) from tableA
where trx_id in (select distinct trx_id from tableB where ... )
group by profile, status;

```

p.s. My Kibana version is 6.2.3

Thank you.

---

<div class="post-metadata">

### Author: ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)
#### Post date: [April 1, 2021, 6:27pm UTC](https://discuss.elastic.co/t/kibana-query-filter-by-result-of-another-saved-search-object-field-data/266656/2 "2021-04-01T18:27:20Z")

</div>

Kibana SQL does not support sub-selects like the one you're showing, and Elasticsearch does not support joins across indices. You can use the aggregations in Elasticsearch to do very powerful grouping like you've shown, but all the relevant data needs to be part of the same document. This is the standard way that a document store like Elasticsearch needs denormalized data.

---

<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: [April 29, 2021, 6:28pm UTC](https://discuss.elastic.co/t/kibana-query-filter-by-result-of-another-saved-search-object-field-data/266656/3 "2021-04-29T18:28:12Z")

</div>

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