bucketMeasure()
Home > @gooddata/sdk-model > bucketMeasure
bucketMeasure() function
Gets first measure matching the provided predicate from the bucket.
Signature:
export declare function bucketMeasure(bucket: IBucket, idOrFun?: string | MeasurePredicate): IMeasure | undefined;
Parameters
Parameter | Type | Description |
---|---|---|
bucket | IBucket | bucket to to search in |
idOrFun | string | MeasurePredicate | (Optional) measure identifier or instance of MeasurePredicate; anyMeasure predicate is default |
Returns:
IMeasure | undefined
undefined if no matching measure is found
Remarks
If no predicate is provided, then the function defaults to anyMeasure predicate - meaning first found measure will be returned.
This function also provides convenience to find measure by its local identifier - if you pass predicate as string the function will automatically create idMatchMeasure predicate.