# Problem ordering data sorted by range at Vertical Bar Visualization

**URL:** <https://discuss.elastic.co/t/problem-ordering-data-sorted-by-range-at-vertical-bar-visualization/151581>\
**Category:** Kibana\
**Created:** [October 9, 2018, 9:13am UTC](https://discuss.elastic.co/t/problem-ordering-data-sorted-by-range-at-vertical-bar-visualization/151581 "2018-10-09T09:13:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ratman](https://avatars.discourse-cdn.com/v4/letter/r/3be4f8/32.png) [@ratman](https://discuss.elastic.co/u/ratman)\
**Post date:** [October 9, 2018, 9:13am UTC](https://discuss.elastic.co/t/problem-ordering-data-sorted-by-range-at-vertical-bar-visualization/151581/1 "2018-10-09T09:13:30Z")

</div>

Hello!

I am handling some data that I want to sort by "time of the day - range" so I've created in logstash an auxiliary field "Hora" which extracts the Hour from the timestamp.

Then, in my visualization I've created the Range I want the data sorted by and I've added a sub-bucket with the cities I am also sorting the data by.

The problem is that I don't manage to order the ranges by their logical order (9-11, 11-13...) they're just getting ordered randomly. Any idea about how can I solve this? Could this be a glitch?

 ![kibana_screenshot](https://us1.discourse-cdn.com/elastic/original/3X/7/d/7da6557fa92ac55531be26813a52c52a0f7ea669.png)

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [October 10, 2018, 10:46am UTC](https://discuss.elastic.co/t/problem-ordering-data-sorted-by-range-at-vertical-bar-visualization/151581/2 "2018-10-10T10:46:12Z")

</div>

I don't have a data set that currently allows me to test this, but until I get one could you try to change to a Histogram aggregation with 2 set as an interval. That should work better than the Range aggregation.

---

<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 7, 2018, 10:46am UTC](https://discuss.elastic.co/t/problem-ordering-data-sorted-by-range-at-vertical-bar-visualization/151581/3 "2018-11-07T10:46:12Z")

</div>

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