Skip to main content

List.Accumulate

Accumulates a summary value from the items in the list.

Syntax

List.Accumulate(
list as list,
seed as any,
accumulator as function
) as any

Remarks

Accumulates a summary value from the items in the list list, using accumulator. An optional seed parameter, seed, may be set.

Examples

Example #1

Accumulates the summary value from the items in the list {1, 2, 3, 4, 5} using ((state, current) => state + current ).

List.Accumulate({1, 2, 3, 4, 5}, 0, (state, current) => state + current)

Result:

15

Category

List.Transformation functions