MeasureBuilder
Builder for simple measures.
Do not instantiate this builder directly, instead use newMeasure() or modifyMeasure() functions.
export declare class MeasureBuilder extends MeasureBuilderBase<IMeasureDefinition>
Extends: MeasureBuilderBase<IMeasureDefinition>
Remarks
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the MeasureBuilder class.
Properties
Property | Modifiers | Type | Description |
|---|---|---|---|
(aggregation?: MeasureAggregation) => this | Sets aggregation to use for measures created from facts. | ||
() => this | Resets measure aggregation to the default (SUM). | ||
(…filters: IMeasureFilter[]) => this | Sets filters to apply when calculating the values of this measure. | ||
(ref: ObjRef) => this | Sets reference to measure item that will be used for calculation. | ||
() => this | Resets measure filters - this will remove all filters from the measure. | ||
() => this | Resets compute as ratio indicator. | ||
(value?: boolean) => this | Indicates that the measure values should be calculated as percent contributions to the total unsliced value. |
Methods
Method | Modifiers | Description |
|---|---|---|
| ||
|
Property details
MeasureBuilder.aggregationproperty
Sets aggregation to use for measures created from facts.
aggregation: (aggregation?: MeasureAggregation) => this;
Remarks
By default the aggregation is SUM. For convenience the aggregation can be specified also for measures created from metrics - and in that case it will be ignored.
For convenience, the aggregation may be undefined and it means the value should be reset to the default.
MeasureBuilder.defaultAggregationproperty
Resets measure aggregation to the default (SUM).
defaultAggregation: () => this;
MeasureBuilder.filtersproperty
Sets filters to apply when calculating the values of this measure.
filters: (...filters: IMeasureFilter[]) => this;
Remarks
These filters apply only to this particular measure calculation and do not impact the rest of the execution.
MeasureBuilder.measureItemproperty
Sets reference to measure item that will be used for calculation.
measureItem: (ref: ObjRef) => this;
Remarks
This can be either reference to a MAQL metric or a fact to calculate from.
MeasureBuilder.noFiltersproperty
Resets measure filters - this will remove all filters from the measure.
noFilters: () => this;
MeasureBuilder.noRatioproperty
Resets compute as ratio indicator.
noRatio: () => this;
MeasureBuilder.ratioproperty
Indicates that the measure values should be calculated as percent contributions to the total unsliced value.
ratio: (value?: boolean) => this;
Remarks
This method works as ’turn-on-toggle’ by default, however you can specify the actual boolean parameter and turn the ratio computation off using this method.
Method details
MeasureBuilder.buildDefinition()method
protected buildDefinition(): IMeasureDefinition;
Returns
MeasureBuilder.generateLocalId()method
protected generateLocalId(): string;
Returns
string