# TSVB Table : is There a way to sort columns?

**URL:** https://discuss.elastic.co/t/tsvb-table-is-there-a-way-to-sort-columns/227977
**Category:** Kibana
**Created:** [April 14, 2020, 6:30pm UTC](https://discuss.elastic.co/t/tsvb-table-is-there-a-way-to-sort-columns/227977 "2020-04-14T18:30:13Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Hamza\_BENNANI](https://avatars.discourse-cdn.com/v4/letter/h/bc8723/32.png) [@Hamza\_BENNANI](https://discuss.elastic.co/u/Hamza_BENNANI)
#### Post date: [April 14, 2020, 6:30pm UTC](https://discuss.elastic.co/t/tsvb-table-is-there-a-way-to-sort-columns/227977/1 "2020-04-14T18:30:13Z")

</div>

Hello,

I would like to know if there is a way to sort columns in TSVB Table in Kibana 7.6.2.  
Anyway, my need is to compute the top 10 of customers based on their turn over. Also, the table must show in a third column, the evolution of the turn over compared to the last year for each customer.  
I was able to do that in TSVB Table but I cannot make a descending sort on the column 'turn over' to get only top 10 customers.

regards,  
Hamza

---

<div class="post-metadata">

### Author: ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)
#### Post date: [April 15, 2020, 8:59am UTC](https://discuss.elastic.co/t/tsvb-table-is-there-a-way-to-sort-columns/227977/2 "2020-04-15T08:59:08Z")

</div>

You might be running into this bug: [https://github.com/elastic/kibana/issues/49626](https://github.com/elastic/kibana/issues/49626)

---

<div class="post-metadata">

### Author: ![Hamza\_BENNANI](https://avatars.discourse-cdn.com/v4/letter/h/bc8723/32.png) [@Hamza\_BENNANI](https://discuss.elastic.co/u/Hamza_BENNANI)
#### Post date: [April 15, 2020, 1:08pm UTC](https://discuss.elastic.co/t/tsvb-table-is-there-a-way-to-sort-columns/227977/3 "2020-04-15T13:08:04Z")

</div>

I don't think it's the same problem because I'm not even able to sort. Also, when I put the mouse cursor over the column title, I have this message: "This column is not sortable".

 ![Capture d’écran 2020-04-15 à 14.57.28](https://us1.discourse-cdn.com/elastic/original/3X/9/9/993911771c080774eebc1faa76d2a9b6fdb6abc5.png)

---

<div class="post-metadata">

### Author: ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)
#### Post date: [April 15, 2020, 1:48pm UTC](https://discuss.elastic.co/t/tsvb-table-is-there-a-way-to-sort-columns/227977/4 "2020-04-15T13:48:45Z")

</div>

Ah, it depends on the data in this column whether you can sort by it. What aggregation are you using for `TO`?

---

<div class="post-metadata">

### Author: ![Hamza\_BENNANI](https://avatars.discourse-cdn.com/v4/letter/h/bc8723/32.png) [@Hamza\_BENNANI](https://discuss.elastic.co/u/Hamza_BENNANI)
#### Post date: [April 15, 2020, 2:06pm UTC](https://discuss.elastic.co/t/tsvb-table-is-there-a-way-to-sort-columns/227977/5 "2020-04-15T14:06:14Z")

</div>

I'm using 'sum agg' for TO and 'bucket script agg' for EVOL LY %. The 'bucket script agg' is based on sum agg and Serial diff agg by the way.

---

<div class="post-metadata">

### Author: ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)
#### Post date: [April 20, 2020, 7:42am UTC](https://discuss.elastic.co/t/tsvb-table-is-there-a-way-to-sort-columns/227977/6 "2020-04-20T07:42:16Z")

</div>

Not all aggregations are possible to sort by (due to the way TSVB builds the Elasticsearch queries behind the scenes).

This is the list of sortable metrics: [https://github.com/elastic/kibana/blob/74b9ed6414d8801d4ac3cd9b62715f9f7c742ec8/src/plugins/vis\_type\_timeseries/common/basic\_aggs.js](https://github.com/elastic/kibana/blob/74b9ed6414d8801d4ac3cd9b62715f9f7c742ec8/src/plugins/vis_type_timeseries/common/basic_aggs.js)

---

<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 18, 2020, 7:42am UTC](https://discuss.elastic.co/t/tsvb-table-is-there-a-way-to-sort-columns/227977/7 "2020-05-18T07:42:21Z")

</div>

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