# Event Counts By Week Table

**URL:** https://discuss.elastic.co/t/event-counts-by-week-table/191438
**Category:** Kibana
**Created:** [July 19, 2019, 6:39pm UTC](https://discuss.elastic.co/t/event-counts-by-week-table/191438 "2019-07-19T18:39:31Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![wwalker](https://avatars.discourse-cdn.com/v4/letter/w/43a26b/32.png) [@wwalker](https://discuss.elastic.co/u/wwalker)
#### Post date: [July 19, 2019, 6:39pm UTC](https://discuss.elastic.co/t/event-counts-by-week-table/191438/1 "2019-07-19T18:39:31Z")

</div>

I've been charged with creating something called an aging chart. According to the requestor, I need to create a table with rows by week ( week 1, week 2, etc...), and then columns counting the number of events that have a field equal to a given string.

| | Open | Close | Progress |
| --- | --- | --- | --- |
| wk1 | 2 | 0 | 25 |
| wk2 | 5 | 1 | 0 |
| wk3 | 4 | 10 | 10 |
| wk4 | 9 | 25 | 7 |

Each week would correspond to a week in the month...so wk1 would be 7/1 - 7/7, for example. I see in Kibana where I can use a data table and filters to define the week row but I was hoping there was a way to generate what I want without "hard coding" the dates into the filter query.

---

<div class="post-metadata">

### Author: ![Bargs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bargs/32/5429_2.png) [@Bargs](https://discuss.elastic.co/u/Bargs)
#### Post date: [July 19, 2019, 9:12pm UTC](https://discuss.elastic.co/t/event-counts-by-week-table/191438/2 "2019-07-19T21:12:46Z")

</div>

The data table doesn't allow you to create columns based on buckets, but you could hack it with a heat map. Just add a date histogram with a weekly interval to the y-axis, and a filters or terms agg to the x-axis. To display the values in each cell you'll need to check the "Show Labels" option in the options tab. Here's an example:

 ![49%20PM](https://us1.discourse-cdn.com/elastic/original/3X/0/1/01dd0e6200771676284de66b9afa6af8cb71f19b.png)

 ![55%20PM](https://us1.discourse-cdn.com/elastic/original/3X/5/b/5b8f42e2006054270df6f2258ea47299f7fb7969.png)

---

<div class="post-metadata">

### Author: ![wwalker](https://avatars.discourse-cdn.com/v4/letter/w/43a26b/32.png) [@wwalker](https://discuss.elastic.co/u/wwalker)
#### Post date: [July 21, 2019, 1:48pm UTC](https://discuss.elastic.co/t/event-counts-by-week-table/191438/3 "2019-07-21T13:48:11Z")

</div>

Does exactly what I want, thanks @Bargs

---

<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: [July 21, 2019, 1:53pm UTC](https://discuss.elastic.co/t/event-counts-by-week-table/191438/4 "2019-07-21T13:53:48Z")

</div>

@wwalker i would also suggest this nice plugin, the [enhanced-table](https://github.com/fbaligand/kibana-enhanced-table), it give you possibility to have a pivot table

---

<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: [August 18, 2019, 2:00pm UTC](https://discuss.elastic.co/t/event-counts-by-week-table/191438/5 "2019-08-18T14:00:48Z")

</div>

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