# TSVB - Data table creating ratio column using filter ratio in aggregation

**URL:** <https://discuss.elastic.co/t/tsvb-data-table-creating-ratio-column-using-filter-ratio-in-aggregation/253019>\
**Category:** Kibana\
**Created:** [October 22, 2020, 2:34pm UTC](https://discuss.elastic.co/t/tsvb-data-table-creating-ratio-column-using-filter-ratio-in-aggregation/253019 "2020-10-22T14:34:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SebastianKluthCSA](https://avatars.discourse-cdn.com/v4/letter/s/dbc845/32.png) [@SebastianKluthCSA](https://discuss.elastic.co/u/SebastianKluthCSA)\
**Post date:** [October 22, 2020, 2:34pm UTC](https://discuss.elastic.co/t/tsvb-data-table-creating-ratio-column-using-filter-ratio-in-aggregation/253019/1 "2020-10-22T14:34:13Z")

</div>

Hi Community,  
I set up a data table using TSVB. The data table includes total numbers as well as ratios, please see the screenshot:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/f/ff367393fb750a0e4a6cc648fb13c7c883679dd1.png)  
The ratios are based on bucket scripts using aggregations:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/9/e9f3f5d2c2725ef9254cfa72df56c506815a939e.png)  
As last column I am trying to add the ratio from total\_volume which includes a specific string. So I assumed to put a filter ratio into one of the bucket script params:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/9/499f9b440908fc121c6adea2e2297c8c8cdce40a.png)  
But it breaks the table panel:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/a/8a64ffe565b183060bb1790ab5a1f6c902a350f4.png)  
What am I doing wrong here? Thanks for your help.

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [October 29, 2020, 7:33pm UTC](https://discuss.elastic.co/t/tsvb-data-table-creating-ratio-column-using-filter-ratio-in-aggregation/253019/2 "2020-10-29T19:33:09Z")

</div>

Hi, it looks like this is a bug in TSVB. I tried reproducing a Filter Ratio column using a sum aggregation on a numeric field, and got the same result.

Unfortunately the error is buried in the JavaScript developer console:

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

The highlighted `[object Object]` part means that data is not serialized properly for the request.

Looks like you did nothing wrong here. Filed this bug: [https://github.com/elastic/kibana/issues/82067](https://github.com/elastic/kibana/issues/82067)

---

<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 26, 2020, 7:33pm UTC](https://discuss.elastic.co/t/tsvb-data-table-creating-ratio-column-using-filter-ratio-in-aggregation/253019/3 "2020-11-26T19:33:11Z")

</div>

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