---
url: /set-instructions/sort-by-value-using-the-next-instruction-ascending.md
description: >-
  Sorts the working set by the value the next instruction produces, ascending.
  Workview column axis only.
---

# Sort By Value Using The Next Instruction (Ascending)

**Workview-only. Column axis only.** Sorts the working list (on the row axis) by the value of a measure or formula specified in the *next* instruction, lowest to highest.

::: warning Needs a value provider immediately after it
This instruction reads its sort criterion from the very next instruction in the stack - it doesn't carry one itself. If that instruction doesn't produce a value (a name-based sort, for example), the sort won't behave as expected.
:::

#### Example

```
1. Element: All Products
2. Expand All
3. Remove Consolidations
4. Sort By Value Using The Next Instruction (Ascending)
5. Insert Using Formula: LINK("Sales", ["Revenue"])
```

Step 5 isn't a separate addition to the set - it's the value step 4 sorts by, ranking every product from lowest to highest Revenue. See [Sort By Value Using The Next Instruction (Descending)](/set-instructions/sort-by-value-using-the-next-instruction-descending) for the more common "top N" direction, and [Common Patterns](/set-instructions/common-patterns#pattern-5-sorting-by-a-measure) for the full pattern.

![Sort By Value Ascending and Descending compared against the same unsorted working set, with the value each sorts by shown alongside](/set-instructions-example-sort-by-value.svg)
