# by-exp modifier

The by-exp modifier designates a sort
key, in ascending, exploded MultiValue order and must be followed
by an attribute name. It may be used with any command that lists or
selects items, such as list or select.

The by-exp modifier is used to sort
attributes that may contain more than one value. When the by modifier is used on a MultiValue attribute, it only
sorts on the first value in the attribute. Further, each item-ID only
displays once, assuming that its display is not suppressed.

When the by-exp modifier is used, it *explodes* each value in the attribute and treats each value as though it were
a separate item. Each value sorts into its proper position, and the
item-ID displays with each value. In other words, the number of times
an item-ID displays on a report coincides to the number of values
in the exploded attribute. The explosion limiter specifies that output
only occurs on data elements meeting the print limiting criteria.

## Syntax

```
by-exp attr.name{"explosion.limiter"}
```
Note: If the by-exp modifier is specified
with a command that does not naturally sort (such as the list command), the command is changed to its sorting counterpart
(for example, list becomes sort, select becomes sselect, and
so on).

## Example(s)

```
list customers by-exp invoice.pointers
```

```
list invoices by-exp product = "widget"
```

```
select fn by-exp pay-date >= "01/01/01" and <= "12/31/01"
```

## See also

- [by modifier](https://d3codex.com/access/by-modifier/)
- [by-dsnd modifier](https://d3codex.com/access/by-dsnd-modifier/)
- [by-exp-dsnd modifier](https://d3codex.com/access/by-exp-dsnd-modifier/)
- [Modifiers](https://d3codex.com/access/modifiers/)
- [readnext statement](https://d3codex.com/pickbasic-flashbasic/readnext-statement/)
- [sort command](https://d3codex.com/access/sort-command/)
- [Value](https://d3codex.com/definitions/value/)

---
Source: https://d3codex.com/access/by-exp-modifier/ - part of the D3Codex reference.
