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

Function withUpdatedFormulaFilter Beta

withUpdatedFormulaFilter(match, updateFn): CalculatedMeasureTransformer

Returns a transformer that functionally updates the filter(s) matching the target, keeping the same context key so the formula expression is left untouched.

Useful for tweaks such as narrowing a filter's members. Returns the measure unchanged when nothing matches.

Parameters

ParameterTypeDescription
matchFormulaFilterMatcherHow to target the filter to update. See FormulaFilterMatcher.
updateFn(filter) => FilterMaps the matched filter to its replacement.

Returns

CalculatedMeasureTransformer

A transformer producing the updated calculated measure.

Example

Narrow the existing filter's members to a fixed set:

const narrowed = withUpdatedFormulaFilter(DM.Category.Category, () =>
  filterFactory.members(DM.Category.Category, ['Cell Phones', 'Laptops']),
)(revenue);
Last Updated: