# Is there any way sort an array from lowest to highest

**URL:** <https://forums.unrealengine.com/t/is-there-any-way-sort-an-array-from-lowest-to-highest/363549>\
**Category:** Blueprint\
**Tags:** leaderboard, unreal-engine, local, UE4, Blueprint, question\
**Created:** [July 10, 2016, 3:46pm UTC](https://forums.unrealengine.com/t/is-there-any-way-sort-an-array-from-lowest-to-highest/363549 "2016-07-10T15:46:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheLazyHatGuy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheLazyHatGuy](https://forums.unrealengine.com/u/TheLazyHatGuy)\
**Post date:** [July 10, 2016, 3:46pm UTC](https://forums.unrealengine.com/t/is-there-any-way-sort-an-array-from-lowest-to-highest/363549/1 "2016-07-10T15:46:22Z")

</div>

I am currently trying to make a local scoreboard and I need a way of ordering the values from lowest to highest.

I know about the method shown here [Sorting Float Array Numerically? - Programming & Scripting - Unreal Engine Forums](https://answers.unrealengine.com/questions/176672/sorting-float-array-numerically.html)  
I need a way to have an array the holds both text (the player’s name) and integers (the players score) and have these in order if biggest score to smallest score so I can promote these value to variables for the GUI

---

<div class="post-metadata">

**Author:** ![DDemon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DDemon](https://forums.unrealengine.com/u/DDemon)\
**Post date:** [July 10, 2016, 4:10pm UTC](https://forums.unrealengine.com/t/is-there-any-way-sort-an-array-from-lowest-to-highest/363549/2 "2016-07-10T16:10:35Z")

</div>

Pretty simple make 2 arrays one holds the score and the second holds the names (when adding or removing from the arrays makes sure to do the same to both of them), then just get the index of the max value remove it from the array with the names(place it in a new array that will be the final one for the names), and then remove the max number itself from the array with the scores(do the same here as the other one), now you have 2 arrays that are ordered by score, when you need the highest score take the index of 0 ( 1 2 …and etc) from both of them and you will have the name and the score.

---

<div class="post-metadata">

**Author:** ![TheLazyHatGuy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheLazyHatGuy](https://forums.unrealengine.com/u/TheLazyHatGuy)\
**Post date:** [July 10, 2016, 4:12pm UTC](https://forums.unrealengine.com/t/is-there-any-way-sort-an-array-from-lowest-to-highest/363549/3 "2016-07-10T16:12:37Z")

</div>

That sounds perfect. Don’t know why I didn’t think of it. Would you by any chance have a picture of an example blueprint?

---

<div class="post-metadata">

**Author:** ![DDemon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DDemon](https://forums.unrealengine.com/u/DDemon)\
**Post date:** [July 11, 2016, 7:07am UTC](https://forums.unrealengine.com/t/is-there-any-way-sort-an-array-from-lowest-to-highest/363549/4 "2016-07-11T07:07:36Z")

</div>

No I don’t have an example for you, its really basic, just do it step after step you finish it in 5 min.

---

<div class="post-metadata">

**Author:** ![TheLazyHatGuy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheLazyHatGuy](https://forums.unrealengine.com/u/TheLazyHatGuy)\
**Post date:** [July 11, 2016, 5:44pm UTC](https://forums.unrealengine.com/t/is-there-any-way-sort-an-array-from-lowest-to-highest/363549/5 "2016-07-11T17:44:47Z")

</div>

Took me a few hours but I got there in the end 😃

---

<div class="post-metadata">

**Author:** ![DDemon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DDemon](https://forums.unrealengine.com/u/DDemon)\
**Post date:** [July 11, 2016, 5:53pm UTC](https://forums.unrealengine.com/t/is-there-any-way-sort-an-array-from-lowest-to-highest/363549/6 "2016-07-11T17:53:39Z")

</div>

Don’t worry next time it will be only copy paste 😛

---

<div class="post-metadata">

**Author:** ![Augurkel](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Augurkel](https://forums.unrealengine.com/u/Augurkel)\
**Post date:** [December 7, 2018, 12:15pm UTC](https://forums.unrealengine.com/t/is-there-any-way-sort-an-array-from-lowest-to-highest/363549/7 "2018-12-07T12:15:19Z")

</div>

A screenshot would be nice for others who might need it. ( Me for example ). I’m still unclear on how to acchieve this.
