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.
Level.isin(*members)
Return a condition evaluating to True where this level’s current member is included in the given members, and evaluating to False elsewhere.
- Parameters:
members (ScalarConstantT_co) – One or more values that the level members will be compared against.
- Return type:
MembershipCondition[TypeAliasForwardRef, Literal[‘IN’], +ScalarConstantT_co] | ~atoti._operation.operation.RelationalCondition[TypeAliasForwardRef, Literal[‘EQ’], +ScalarConstantT_co]
Example
>>> df = pd.DataFrame(
... columns=["City", "Price"],
... data=[
... ("Berlin", 150.0),
... ("London", 240.0),
... ("New York", 270.0),
... ("Paris", 200.0),
... ],
... )
>>> table = session.read_pandas(df, keys={"City"}, table_name="Example")
>>> cube = session.create_cube(table)
>>> l, m = cube.levels, cube.measures
>>> m["Price.SUM in London and Paris"] = tt.filter(
... m["Price.SUM"], l["City"].isin("London", "Paris")
... )
>>> cube.query(
... m["Price.SUM"],
... m["Price.SUM in London and Paris"],
... levels=[l["City"]],
... )
Price.SUM Price.SUM in London and Paris
City
Berlin 150.00
London 240.00 240.00
New York 270.00
Paris 200.00 200.00