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

Function measuredValue

measuredValue( measure, filters, name?, format?): CalculatedMeasure

Creates a measured value with the given measure and set of filters.

A measured value only includes values from items that match the provided filters.

For example you can use a measured value to get a total cost for all items where the cost is greater than 100.

Note that the filters on the measured value override the filters on the query, chart, or table the measured value is used in.

Parameters

ParameterTypeDescription
measureMeasureMeasure to filter
filtersFilter[]Filters to apply to the measure
name?stringOptional name for the new measure
format?stringOptional numeric formatting to apply using a Numeral.js format string. Can only be used for explicit queries. Cannot be used in charts, tables, etc.

Returns

CalculatedMeasure

A calculated measure instance

Example

Calculate the total cost across all items in a category from the Sample Ecommerce data model, where the cost is greater than 100. Additional filtering on the cost will not affect this measure.

measureFactory.measuredValue(
  measureFactory.sum(DM.Commerce.Cost),
  [filterFactory.greaterThan(DM.Commerce.Cost, 100)],
  'Cost Greater Than 100'
),
Last Updated: