# Data explorer - want numerical sort

**URL:** <https://community.dynatrace.com/t/data-explorer-want-numerical-sort/41735>\
**Category:** Dashboarding\
**Tags:** data-explorer, charts\
**Created:** [September 22, 2023, 2:00am UTC](https://community.dynatrace.com/t/data-explorer-want-numerical-sort/41735 "2023-09-22T02:00:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kostellod](https://avatars.discourse-cdn.com/v4/letter/k/22d042/32.png) [@kostellod](https://community.dynatrace.com/u/kostellod)\
**Post date:** [September 22, 2023, 2:00am UTC](https://community.dynatrace.com/t/data-explorer-want-numerical-sort/41735/1 "2023-09-22T02:00:36Z")

</div>

I am creating a table that is displaying data which is split by one of the dimensions whose values range from 0-19. When I add a sort, it’s sorting the values alphabetically, so I get 0, 1, 10, 11, … instead of 0, 1, 2, …&nbsp; &nbsp;How can I make my sort numeric instead of alphabetic?

---

<div class="post-metadata">

**Author:** ![natanael\_mendes](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/natanael_mendes/32/15264_2.png) [@natanael\_mendes](https://community.dynatrace.com/u/natanael_mendes)\
**Post date:** [September 22, 2023, 2:23am UTC](https://community.dynatrace.com/t/data-explorer-want-numerical-sort/41735/2 "2023-09-22T02:23:12Z")

</div>

you got this option to sort

### Sort by

By default, results are sorted in descending order based on the aggregation chosen.

To set the sort order

1. If&nbsp; **Sort by** &nbsp;is not already displayed in the query editor, select&nbsp;&nbsp;and then select&nbsp;Sort by&nbsp;from the list.
2. Set&nbsp; **Sort by** &nbsp;to the dimension by which you want to sort.
3. Select the sort order:&nbsp;ASC&nbsp;(ascending) or&nbsp;DESC&nbsp;(descending).

 ![natanael_mendes_0-1695349339645.png](https://global.discourse-cdn.com/dynatrace/original/3X/8/a/8a1a2f58c1716e56ccf108e76cd7f479737e0ccf.png)

Documentation page

> **[Data Explorer](https://docs.dynatrace.com/docs/analyze-explore-automate/explorer)**
>
> Query for metrics and transform results to gain desired insights.

---

<div class="post-metadata">

**Author:** ![kostellod](https://avatars.discourse-cdn.com/v4/letter/k/22d042/32.png) [@kostellod](https://community.dynatrace.com/u/kostellod)\
**Post date:** [September 22, 2023, 3:31am UTC](https://community.dynatrace.com/t/data-explorer-want-numerical-sort/41735/3 "2023-09-22T03:31:49Z")

</div>

I’ve got a sort added, but it’s not working as I’d like. It’s doing an alphabetic sort - I need numerical.

---

<div class="post-metadata">

**Author:** ![Islam\_Zedan](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/islam_zedan/32/31999_2.png) [@Islam\_Zedan](https://community.dynatrace.com/u/Islam_Zedan)\
**Post date:** [September 22, 2023, 8:29am UTC](https://community.dynatrace.com/t/data-explorer-want-numerical-sort/41735/4 "2023-09-22T08:29:20Z")

</div>

Hello,

Can you send a screenshot of your configurations?

Thanks,

Islam

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [September 22, 2023, 8:54am UTC](https://community.dynatrace.com/t/data-explorer-want-numerical-sort/41735/5 "2023-09-22T08:54:21Z")

</div>

If it’s a dimension, you cannot sort it numerically. Dimension is a string, not a number and is sorted lexicographically as [stated here](https://www.dynatrace.com/support/help/shortlink/api-metrics-v2-selector#sort). The only way I can think of is to replace the data at the source and pad it with zeroes( 0 → 00, 1 → 01, 2 → 02).

---

<div class="post-metadata">

**Author:** ![kostellod](https://avatars.discourse-cdn.com/v4/letter/k/22d042/32.png) [@kostellod](https://community.dynatrace.com/u/kostellod)\
**Post date:** [September 22, 2023, 4:36pm UTC](https://community.dynatrace.com/t/data-explorer-want-numerical-sort/41735/6 "2023-09-22T16:36:28Z")

</div>

Unfortunate. It would be nice to be able to do a transformation on data before it gets sent to the chart.

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [September 22, 2023, 7:29pm UTC](https://community.dynatrace.com/t/data-explorer-want-numerical-sort/41735/7 "2023-09-22T19:29:35Z")

</div>

yes, unfortunate. This probably won’t happen with the classic data explorer and will be possible only with Grail.
