# Dataset: Sort the rows by theire values

**URL:** <https://community.wolfram.com/t/dataset-sort-the-rows-by-theire-values/5181>\
**Category:** Questions\
**Tags:** mathematica\
**Created:** [March 20, 2015, 4:02pm UTC](https://community.wolfram.com/t/dataset-sort-the-rows-by-theire-values/5181 "2015-03-20T16:02:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielbraendli](https://avatars.discourse-cdn.com/v4/letter/d/b4bc9f/32.png) [@danielbraendli](https://community.wolfram.com/u/danielbraendli)\
**Post date:** [March 20, 2015, 4:02pm UTC](https://community.wolfram.com/t/dataset-sort-the-rows-by-theire-values/5181/1 "2015-03-20T16:02:52Z")

</div>

Hi everyone,

I am new in the mathematica community and I have a probably easy question for you regarding how to sort a dataset as the following so that I have sorted the values in the fist row descending from 44 in the first line down to 3 in the last one.

dataset = Dataset[{  
\<|“a” → 6, “b” → “x”, “c” → {1}|\>,  
\<|“a” → 8, “b” → “y”, “c” → {2, 3}|\>,  
\<|“a” → 44, “b” → “z”, “c” → {3}|\>,  
\<|“a” → 4, “b” → “x”, “c” → {4, 5}|\>,  
\<|“a” → 5, “b” → “y”, “c” → {5, 6, 7}|\>,  
\<|“a” → 3, “b” → “z”, “c” → {}|\>}]

Many thanks for your support and best regards

---

<div class="post-metadata">

**Author:** ![mthiel](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mthiel/32/42877_2.png) [@mthiel](https://community.wolfram.com/u/mthiel)\
**Post date:** [March 20, 2015, 6:32pm UTC](https://community.wolfram.com/t/dataset-sort-the-rows-by-theire-values/5181/2 "2015-03-20T18:32:06Z")

</div>

Hi,

you can easily sort the underlying association:

```
Reverse@Sort[dataset // Normal] // Dataset

```

 ![ScreenShot2015-03-20at18.31.21.png](https://global.discourse-cdn.com/wolfram/original/3X/4/d/4d67c3d29a5a99e47336413ee22a3fe4a7a79d4f.png)

Alternatively,

```
Sort[dataset][Reverse]

```

should work.

Cheers,

M.

---

<div class="post-metadata">

**Author:** ![danielbraendli](https://avatars.discourse-cdn.com/v4/letter/d/b4bc9f/32.png) [@danielbraendli](https://community.wolfram.com/u/danielbraendli)\
**Post date:** [March 20, 2015, 7:08pm UTC](https://community.wolfram.com/t/dataset-sort-the-rows-by-theire-values/5181/3 "2015-03-20T19:08:47Z")

</div>

Perfect! Thank you very much for your quick response!
