# Accessing two various indexes in canvas datatable

**URL:** <https://discuss.elastic.co/t/accessing-two-various-indexes-in-canvas-datatable/259134>\
**Category:** Kibana\
**Created:** [December 18, 2020, 6:56pm UTC](https://discuss.elastic.co/t/accessing-two-various-indexes-in-canvas-datatable/259134 "2020-12-18T18:56:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alfar](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@Alfar](https://discuss.elastic.co/u/Alfar)\
**Post date:** [December 18, 2020, 6:56pm UTC](https://discuss.elastic.co/t/accessing-two-various-indexes-in-canvas-datatable/259134/1 "2020-12-18T18:56:37Z")

</div>

I want to populate a data table in canvas with this kind of query

SELECT student\_id,name,address,department\_id  
FROM student  
WHERE department\_id IN (  
SELECT department\_id FROM department WHERE department\_name ="Engineering" )

I got to know that elasticsearch does not support it, but I need suggestions to do this with scripted field or expression editor or logstash or anything.Please help

---

<div class="post-metadata">

**Author:** ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)\
**Post date:** [December 18, 2020, 7:06pm UTC](https://discuss.elastic.co/t/accessing-two-various-indexes-in-canvas-datatable/259134/2 "2020-12-18T19:06:13Z")

</div>

Make sur you have all attributes inside same document in elasticsearch :

- student\_id
- name
- address
- department\_id
- department\_name

---

<div class="post-metadata">

**Author:** ![Alfar](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@Alfar](https://discuss.elastic.co/u/Alfar)\
**Post date:** [December 19, 2020, 4:45am UTC](https://discuss.elastic.co/t/accessing-two-various-indexes-in-canvas-datatable/259134/3 "2020-12-19T04:45:21Z")

</div>

Thanks for your response @ylasri.student and department are seperated index.without having a common index i want to have both in essql(join query or nested query).I admit that it is complex.Thankful if you can suggest me a different way

---

<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:** [January 16, 2021, 4:45am UTC](https://discuss.elastic.co/t/accessing-two-various-indexes-in-canvas-datatable/259134/4 "2021-01-16T04:45:26Z")

</div>

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