Function mapFormulaFilters Beta
mapFormulaFilters(
mapFn):CalculatedMeasureTransformer
Returns a transformer that maps over every filter in a calculated measure formula's context, keeping each filter's context key.
Returns the measure unchanged when the mapping produces no new filter reference.
Parameters
| Parameter | Type | Description |
|---|---|---|
mapFn | (filter, key) => Filter | Maps each filter (and its bracketed context key) to its replacement. |
Returns
A transformer producing the updated calculated measure.
Example
Apply the same transform to every filter in the formula:
const reselected = mapFormulaFilters((filter) =>
filterFactory.members(filter.attribute, ['Cell Phones']),
)(revenue);