Skip to main content
atoti.rank(
    measure: VariableMeasureConvertible,
    hierarchy: Hierarchy,
    /,
    *,
    ascending: bool = True,
    apply_filters: bool = True,
) → MeasureDefinition
Return a measure equal to the rank of a hierarchy’s members according to a reference measure. Members with equal values are further ranked using the level order.

Parameters

measure

The measure on which the ranking is done.

hierarchy

The hierarchy containing the members to rank.

ascending

When set to False, the 1st place goes to the member with greatest value.

apply_filters

When True, query filters on the given hierarchy will be applied before ranking members. When False, query filters on the given hierarchy will be applied after the ranking, resulting in “holes” in the ranks.
2000-01-01 and 2000-01-05 have the same Quantity.SUM value so they’re ranked according to l[“Day”].order.