bucketMeasureIndex()
Home > @gooddata/sdk-model > bucketMeasureIndex
bucketMeasureIndex() function
Gets the index of the first measure matching the provided predicate from the bucket.
Signature:
export declare function bucketMeasureIndex(bucket: IBucket, idOrFun?: string | MeasurePredicate): number;
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:
number
-1 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.