> ## 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.

# Cube.create_parameter_hierarchy_from_members()

> Cube.create\_parameter\_hierarchy\_from\_members(\
>
>     *name*: [str](https://docs.python.org/3/builtins/stdtypes.html#str),\
>
>     *members*: Sequence\[Constant],\
>
>     \*,\
>
>     *data\_type*: DataType | [None](https://docs.python.org/3/builtins/constants.html#None) = `None`,\
>
>     *index\_measure\_name*: [str](https://docs.python.org/3/builtins/stdtypes.html#str) | [None](https://docs.python.org/3/builtins/constants.html#None) = `None`,\
>
> ) → [None](https://docs.python.org/3/builtins/constants.html#None)

Create a single-level hierarchy with the given members.

It can be used as a parameter hierarchy in advanced analyzes.

### Parameters

#### *name*

The name of hierarchy and its single level.

#### *members*

The members of the hierarchy.

#### *data\_type*

The type with which the members will be stored.
Automatically inferred by default.

#### *index\_measure\_name*

The name of the indexing measure to create for this hierarchy, if any.

***

```pycon theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
>>> df = pd.DataFrame(
...     {
...         "Seller": ["Seller_1", "Seller_2", "Seller_3"],
...         "Prices": [
...             [2.5, 49.99, 3.0, 54.99],
...             [2.6, 50.99, 2.8, 57.99],
...             [2.99, 44.99, 3.6, 59.99],
...         ],
...     }
... )
>>> table = session.read_pandas(df, table_name="Seller prices")
>>> cube = session.create_cube(table)
>>> l, m = cube.levels, cube.measures
>>> cube.create_parameter_hierarchy_from_members(
...     "ProductID",
...     ["aBk3", "ceJ4", "aBk5", "ceJ9"],
...     index_measure_name="Product index",
... )
>>> m["Prices"] = tt.agg.single_value(table["Prices"])
>>> m["Product price"] = m["Prices"][m["Product index"]]
>>> cube.query(
...     m["Product price"],
...     levels=[l["Seller"], l["ProductID"]],
... )
                   Product price
Seller   ProductID
Seller_1 aBk3               2.50
         aBk5               3.00
         ceJ4              49.99
         ceJ9              54.99
Seller_2 aBk3               2.60
         aBk5               2.80
         ceJ4              50.99
         ceJ9              57.99
Seller_3 aBk3               2.99
         aBk5               3.60
         ceJ4              44.99
         ceJ9              59.99
```
