applyRatioRule()
Home > @gooddata/sdk-model > applyRatioRule
applyRatioRule() function
Applies compute ratio rule to all measures in a list.
Signature:
export declare function applyRatioRule<T extends IAttributeOrMeasure>(items: T[], rule?: ComputeRatioRule): T[];
Parameters
Parameter | Type | Description |
---|---|---|
items | T[] | list of attributes or measures to sanitize; attributes will be lef |
rule | ComputeRatioRule | (Optional) rule to apply; see ComputeRatioRule |
Returns:
T[]
new list with modified measures; the original list and measures in it are left intact
Remarks
This MAY be done to sanitize measure definitions so that the computed results make sense when visualized in a chart.
The function will return a new list with updated measures according to the specified rule; see ComputeRatioRule.
For convenience this function can work with list of measures AND attributes; attributes will be ignored in processing and kept in resulting array as-is.