# Data View, Canvas, and ESQL

**URL:** https://discuss.elastic.co/t/data-view-canvas-and-esql/336474
**Category:** Kibana
**Created:** [June 20, 2023, 11:52am UTC](https://discuss.elastic.co/t/data-view-canvas-and-esql/336474 "2023-06-20T11:52:48Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![witwit](https://avatars.discourse-cdn.com/v4/letter/w/74df32/32.png) [@witwit](https://discuss.elastic.co/u/witwit)
#### Post date: [June 20, 2023, 11:52am UTC](https://discuss.elastic.co/t/data-view-canvas-and-esql/336474/1 "2023-06-20T11:52:48Z")

</div>

Hi,  
So i have an index which is created from a transform with group by on a field and aggregation using terms.  
This means that my resulting field is a flattened field of terms.  
Through this I can create Data View terms to display on discovery and finally on canvas as a table to view this index.

However, can I do more than that?  
Example  
 ![Screenshot from 2023-06-20 14-49-59](https://us1.discourse-cdn.com/elastic/original/3X/5/d/5dc990dc97fd6317b0c510e2f6eb58a73b37a280.png)  
I would like to display the sum of rows that have started = 1 and finished = 0.  
Currently, i'm trying to make this work using ESQL count feature but it cant see nor access the flattened term in the index or the data view fields that I've created.

A solution would be greatly appreciated because otherwise i'll be displaying kind of an inaccurate metric if I use the original index instead of the transformed index.

---

<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: [June 20, 2023, 5:35pm UTC](https://discuss.elastic.co/t/data-view-canvas-and-esql/336474/2 "2023-06-20T17:35:48Z")

</div>

Could you provide an example of what your documents look like?

---

<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: [July 18, 2023, 5:35pm UTC](https://discuss.elastic.co/t/data-view-canvas-and-esql/336474/3 "2023-07-18T17:35:53Z")

</div>

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