# Combining two count select queries to create a data table in canvas essql

**URL:** <https://discuss.elastic.co/t/combining-two-count-select-queries-to-create-a-data-table-in-canvas-essql/298318>\
**Category:** Kibana\
**Tags:** canvas\
**Created:** [February 25, 2022, 10:54pm UTC](https://discuss.elastic.co/t/combining-two-count-select-queries-to-create-a-data-table-in-canvas-essql/298318 "2022-02-25T22:54:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Moni](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@Moni](https://discuss.elastic.co/u/Moni)\
**Post date:** [February 25, 2022, 10:54pm UTC](https://discuss.elastic.co/t/combining-two-count-select-queries-to-create-a-data-table-in-canvas-essql/298318/1 "2022-02-25T22:54:21Z")

</div>

Hello experts,

I am following [https://www.elastic.co/guide/en/kibana/master/canvas-function-reference.html](https://www.elastic.co/guide/en/kibana/master/canvas-function-reference.html)  
to create a single data table from two queries. Attached a screenshot of the same page below.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/7/07e54b9229e52f4104bd2f6cc05d0151e0932e0a.png)

However, in my case the individual queries returns multiple rows as I am using "select count(\*)...group by department, class ..." in my queries. In this example above when I try to implement I get just one row in the final table. If I use the rowCount = 10, the same raw gets repeated 10 times.  
My question is how do I get all the rows from the queries and combine it into one table ?? instead of just one row ?

e.g.

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

---

<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:** [March 25, 2022, 10:54pm UTC](https://discuss.elastic.co/t/combining-two-count-select-queries-to-create-a-data-table-in-canvas-essql/298318/2 "2022-03-25T22:54:38Z")

</div>

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