sisense.com
✅ You are viewing documentation for the latest version of Compose SDK.
Version:

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

ParameterTypeDescription
mapFn(filter, key) => FilterMaps each filter (and its bracketed context key) to its replacement.

Returns

CalculatedMeasureTransformer

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);
Last Updated: