# Canvas: Cumulative sum of counts

**URL:** https://discuss.elastic.co/t/canvas-cumulative-sum-of-counts/175380
**Category:** Kibana
**Tags:** canvas
**Created:** [April 4, 2019, 10:14am UTC](https://discuss.elastic.co/t/canvas-cumulative-sum-of-counts/175380 "2019-04-04T10:14:25Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![superfly86](https://avatars.discourse-cdn.com/v4/letter/s/6f9a4e/32.png) [@superfly86](https://discuss.elastic.co/u/superfly86)
#### Post date: [April 4, 2019, 10:14am UTC](https://discuss.elastic.co/t/canvas-cumulative-sum-of-counts/175380/1 "2019-04-04T10:14:25Z")

</div>

Kibana novice here...

I'm using ElasticseachSQL queries to populate elements in Canvas.

I'd like to find a way of creating a Line chart to display a DAILY cumulative count of row entries for a given month.

To get the entries i do the following:

SELECT COUNT(\*) AS entries, DAY\_OF\_MONTH(entry\_date) AS day FROM data\_table WHERE MONTH\_OF\_YEAR(entry\_date) = MONTH\_OF\_YEAR(NOW()) AND YEAR(entry\_date) = YEAR(NOW()) GROUP BY day ORDER BY day

This gives me this lovely table:

day | entries  
------+------------  
1 |464  
2 |180  
3 |179  
4 |378

Now i want another column where it keeps track of the cumulative count:

day | entries | **cumulative count**  
------+-------------+--------------------------  
1 |464 | **464**  
2 |180 | **644**  
3 |179 | **823**  
4 |378 | **1,201**

how do i do this?

Most answers elsewhere mention windowing, but this doesn't seem supported in ESSQL.

Here's hoping...

---

<div class="post-metadata">

### Author: ![thomasneirynck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomasneirynck/32/23313_2.png) [@thomasneirynck](https://discuss.elastic.co/u/thomasneirynck)
#### Post date: [April 4, 2019, 5:54pm UTC](https://discuss.elastic.co/t/canvas-cumulative-sum-of-counts/175380/2 "2019-04-04T17:54:24Z")

</div>

@superfly86

not in Canvas, but in the regular Visualizations of Kibana you can do this with the cumulative sum pipeline aggregation

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

you could create a regular Dashboard iso a Canvas workpad with this table.

---

<div class="post-metadata">

### Author: ![superfly86](https://avatars.discourse-cdn.com/v4/letter/s/6f9a4e/32.png) [@superfly86](https://discuss.elastic.co/u/superfly86)
#### Post date: [April 4, 2019, 6:30pm UTC](https://discuss.elastic.co/t/canvas-cumulative-sum-of-counts/175380/3 "2019-04-04T18:30:02Z")

</div>

@thomasneirynck

> not in Canvas, but in the regular Visualizations of Kibana you can do this with the cumulative sum pipeline aggregation

Yes, exactly, i have been able to produce the exact chart i need in Visualisations, however i'd like it part of a Canvas alongside other metrics (for display purposes)

> you could create a regular Dashboard iso a Canvas workpad with this table.

Could you clarify - can i create a visualisation and copy it across to Canvas?

---

<div class="post-metadata">

### Author: ![thomasneirynck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomasneirynck/32/23313_2.png) [@thomasneirynck](https://discuss.elastic.co/u/thomasneirynck)
#### Post date: [April 4, 2019, 6:59pm UTC](https://discuss.elastic.co/t/canvas-cumulative-sum-of-counts/175380/4 "2019-04-04T18:59:48Z")

</div>

no, you cannot add visualizations from the Kibana Visualize app to a Canvas workpad now.

I meant that perhaps a dashboard with that visualization would work for your purposes as well. Although I do understand that Canvas has more styling options for look&feel.

---

<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: [May 2, 2019, 6:59pm UTC](https://discuss.elastic.co/t/canvas-cumulative-sum-of-counts/175380/5 "2019-05-02T18:59:53Z")

</div>

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