> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# atoti.CustomOrder

### *final class* atoti.CustomOrder

Custom order with the given first elements.

### Example

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> df = pd.DataFrame(
...     {
...         "Product": ["TV", "Smartphone", "Computer", "Screen"],
...         "Quantity": [12, 18, 50, 68],
...     }
... )
>>> table = session.read_pandas(df, table_name="Products")
>>> cube = session.create_cube(table)
>>> l, m = cube.levels, cube.measures
>>> cube.query(m["Quantity.SUM"], levels=[l["Product"]])
           Quantity.SUM
Product
Computer             50
Screen               68
Smartphone           18
TV                   12
>>> l["Product"].order = tt.CustomOrder(first_elements=["TV", "Screen"])
>>> cube.query(m["Quantity.SUM"], levels=[l["Product"]])
           Quantity.SUM
Product
TV                   12
Screen               68
Computer             50
Smartphone           18
```

#### first\_elements *: [Sequence](https://docs.python.org/3/library/collections.abc.html#collections.abc.Sequence)\[[bool](https://docs.python.org/3/library/functions.html#bool) | [int](https://docs.python.org/3/library/functions.html#int) | [float](https://docs.python.org/3/library/functions.html#float) | [date](https://docs.python.org/3/library/datetime.html#datetime.date) | [datetime](https://docs.python.org/3/library/datetime.html#datetime.datetime) | [time](https://docs.python.org/3/library/datetime.html#datetime.time) | [str](https://docs.python.org/3/library/stdtypes.html#str)]*
