# Sort on TSVB column when Last Value is selected

**URL:** https://discuss.elastic.co/t/sort-on-tsvb-column-when-last-value-is-selected/268662
**Category:** Kibana
**Created:** [March 29, 2021, 1:32pm UTC](https://discuss.elastic.co/t/sort-on-tsvb-column-when-last-value-is-selected/268662 "2021-03-29T13:32:34Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Raynb](https://avatars.discourse-cdn.com/v4/letter/r/edb3f5/32.png) [@Raynb](https://discuss.elastic.co/u/Raynb)
#### Post date: [March 29, 2021, 1:32pm UTC](https://discuss.elastic.co/t/sort-on-tsvb-column-when-last-value-is-selected/268662/1 "2021-03-29T13:32:34Z")

</div>

I have a TSVB table that is showing simple aggregations (sum of field) and I am showing it as last value. However when I sort descending it is instead sorting based on the entire time range (sort order does not match numbers displayed, but it does match if I change the field from Last Value to Full Range).

Is this a known bug? Is there a way for the sort to respect my Last Value selection?

---

<div class="post-metadata">

### Author: ![Marta\_Bondyra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marta_bondyra/32/102122_2.png) [@Marta\_Bondyra](https://discuss.elastic.co/u/Marta_Bondyra)
#### Post date: [March 30, 2021, 9:57am UTC](https://discuss.elastic.co/t/sort-on-tsvb-column-when-last-value-is-selected/268662/2 "2021-03-30T09:57:32Z")

</div>

Hi @Raynb , what version of Kibana do you use? I've checked on the 7.12 and it works fine there, unless I am missing something. Let me know!

---

<div class="post-metadata">

### Author: ![Raynb](https://avatars.discourse-cdn.com/v4/letter/r/edb3f5/32.png) [@Raynb](https://discuss.elastic.co/u/Raynb)
#### Post date: [April 6, 2021, 7:16pm UTC](https://discuss.elastic.co/t/sort-on-tsvb-column-when-last-value-is-selected/268662/3 "2021-04-06T19:16:21Z")

</div>

Hi - Thanks for the response (and apologies for my late turnaround)  
I'm on 7.11. Let me try to give more detail. I'm splitting my table by "page.keyword" and then aggregating a bunch of measures against it such as pageviews and last week pageviews. The TSVB is on a dashboard and hardcoded to the last 21 days in order to properly do the derivative.

You'll notice in my sort the 2nd and 3rd column aren't coming in right. If I change my panel options to all time it seems to sort absolutely properly (leading me to believe it's sorting based on all time records in the filter and not my last 7 days records).

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/a/9aaa42a992ce631ea7b02779f7ff0ae682a99175.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/e/aed26cf20cca9149f12f3e66c71bd374528d2166.png)

---

<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 4, 2021, 7:17pm UTC](https://discuss.elastic.co/t/sort-on-tsvb-column-when-last-value-is-selected/268662/4 "2021-05-04T19:17:03Z")

</div>

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