# Creating a custom table visualization

**URL:** <https://discuss.elastic.co/t/creating-a-custom-table-visualization/203141>\
**Category:** Kibana\
**Created:** [October 11, 2019, 5:01am UTC](https://discuss.elastic.co/t/creating-a-custom-table-visualization/203141 "2019-10-11T05:01:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kb\_z](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kb_z/32/48231_2.png) [@kb\_z](https://discuss.elastic.co/u/kb_z)\
**Post date:** [October 11, 2019, 5:01am UTC](https://discuss.elastic.co/t/creating-a-custom-table-visualization/203141/1 "2019-10-11T05:01:11Z")

</div>

Hi,

I have an index which keeps track of user transactions:

`Table 1`

| user | paid\_amount | date |
| --- | --- | --- |
| a | 100 | 2019-10-09T10:00:00.00Z |
| a | 100 | 2019-10-09T10:05:00.00Z |
| a | 100 | 2019-10-09T10:10:00.00Z |
| a | 200 | 2019-10-09T10:25:00.00Z |
| b | 100 | 2019-10-09T10:00:00.00Z |
| c | 200 | 2019-10-09T10:00:00.00Z |

From this, I extract the following data:

`Table 2`

| user | avg\_trans\_amount |
| --- | --- |
| a | 125 |
| b | 100 |
| c | 200 |

So far so good.

Now, what I need to do is: from the extracted data, I need to create a new table creating tiers using the values from the avg\_trans\_amount, as well as add custom operations on the resulting values, as follows (values in parenthesis are just to visualize the math)  
`Table 3`

| min | max | count | math1 ('max'\* 'count') | math2 (sum of 'math1' from current row) |
| --- | --- | --- | --- | --- |
| 1 | 100 | 1 (b) | 100 ( 100 \* 1 ) | 500 (100 + 400 + 0) |
| 101 | 200 | 2 (a,c) | 400 (200 \* 2 ) | 400 (400 + 0) |
| 201 | Infinity | 0 | 0 ( 0 \* 0 ) | 0 ( 0 ) |

I was also asked to make a bar graph of the tiers (`Table 3`) using max as the x axis and count as y

Is there any way of creating such a graph and table in Kibana using visualizations?

Any help is kindly appreciated.

Thanks in advance.

---

<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:** [October 17, 2019, 7:26pm UTC](https://discuss.elastic.co/t/creating-a-custom-table-visualization/203141/2 "2019-10-17T19:26:30Z")

</div>

I can't think of a way to accomplish this in Kibana. There _might_ be a way after bucket script aggregations are supported, but I'm still not even sure how you would accomplish it there.

---

<div class="post-metadata">

**Author:** ![kb\_z](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kb_z/32/48231_2.png) [@kb\_z](https://discuss.elastic.co/u/kb_z)\
**Post date:** [October 18, 2019, 1:26am UTC](https://discuss.elastic.co/t/creating-a-custom-table-visualization/203141/3 "2019-10-18T01:26:05Z")

</div>

Thanks for your reply.

Would it be possible to implement the table without the _math\*_ bits?

As in... create an aggregation using the output of another aggregation. Or is this something that's not supported by ES/Kibana?

Thanks in advance,  
kb\_z

---

<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:** [November 15, 2019, 1:26am UTC](https://discuss.elastic.co/t/creating-a-custom-table-visualization/203141/4 "2019-11-15T01:26:08Z")

</div>

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