# Order by Math Aggregation in TSVB Top N Visualisation

**URL:** <https://discuss.elastic.co/t/order-by-math-aggregation-in-tsvb-top-n-visualisation/209646>\
**Category:** Kibana\
**Created:** [November 27, 2019, 9:47am UTC](https://discuss.elastic.co/t/order-by-math-aggregation-in-tsvb-top-n-visualisation/209646 "2019-11-27T09:47:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bruce289](https://avatars.discourse-cdn.com/v4/letter/b/7bcc69/32.png) [@bruce289](https://discuss.elastic.co/u/bruce289)\
**Post date:** [November 27, 2019, 9:47am UTC](https://discuss.elastic.co/t/order-by-math-aggregation-in-tsvb-top-n-visualisation/209646/1 "2019-11-27T09:47:44Z")

</div>

Hi,

I'm trying to use the Top N visualisation to obtain a list of hosts sorted by CPU usage descending. To do this, I am dividing CPU usage by the number of cores on the system using a pipeline math aggregation. However, I am then unable to sort by this aggregation:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/7/57d066249b767f6607d131cf5daaee1015b3663f.png)

Should I be going about this another way? I have a separate need to sort by a derivative aggregation, and that is not possible either.

Any help would be much appreciated.

Thanks.

---

<div class="post-metadata">

**Author:** ![markov00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/markov00/32/33316_2.png) [@markov00](https://discuss.elastic.co/u/markov00)\
**Post date:** [November 27, 2019, 2:57pm UTC](https://discuss.elastic.co/t/order-by-math-aggregation-in-tsvb-top-n-visualisation/209646/2 "2019-11-27T14:57:33Z")

</div>

Hi @bruce289  
I've tested locally and I can confirm that this is not possible at the moment. Could you please open an enhancement request into the Kibana repo?

> **[Build software better, together](https://github.com/elastic/kibana/issues/new?template=Feature_request.md)**
>
> GitHub is where people build software. More than 40 million people use GitHub to discover, fork, and contribute to over 100 million projects.

In the meantime I will investigate if there is a workaround

---

<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:** [December 25, 2019, 2:57pm UTC](https://discuss.elastic.co/t/order-by-math-aggregation-in-tsvb-top-n-visualisation/209646/3 "2019-12-25T14:57:34Z")

</div>

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