insightReduceItems()
Home > @gooddata/sdk-model > insightReduceItems
insightReduceItems() function
Creates a new insight with reduced bucket items (retrieved by applying the modifications function).
Signature:
export declare function insightReduceItems<T extends IInsightDefinition>(insight: T, reducer?: BucketItemReducer): T;
Parameters
Parameter | Type | Description |
---|---|---|
insight | T | insight to use as template for the new insight |
reducer | BucketItemReducer | (Optional) reduce function to apply to the bucket items |
Returns:
T
always new instance
Remarks
Note: the bucket item modification function SHOULD NOT modify bucket item's localId. The localId MAY be used to reference the item from other places in the insight (for example from sorts). Changing the item localId has potential to break the insight: as-is this function does not concern itself with changing the references.