atoti.Measure.isin()#
- Measure.isin(*values: Constant) IsInCondition[MeasureIdentifier, 'IS_IN', Constant] | RelationalCondition[MeasureIdentifier, 'EQ', Constant] #
- Measure.isin(*values: Constant | None) IsInCondition[MeasureIdentifier, 'IS_IN', Constant | None] | RelationalCondition[MeasureIdentifier, 'EQ', Constant | None]
Return a condition evaluating to
True
where this measure evaluates to one of the given values, and evaluating toFalse
elsewhere.- Parameters:
values – One or more values that the measure will be compared against.
Example
>>> df = pd.DataFrame( ... columns=["City", "Price"], ... data=[ ... ("Berlin", 150), ... ("London", 270), ... ("Madrid", 200), ... ], ... ) >>> table = session.read_pandas(df, keys={"City"}, table_name="Example") >>> cube = session.create_cube(table) >>> m = cube.measures >>> m["Price.SUM"].isin(150, 270) m['Price.SUM'].isin(150, 270)
Conditions on single values are normalized to equality conditions:
>>> m["Price.SUM"].isin(150) m['Price.SUM'] == 150