Forum Discussion

ziying35's avatar
ziying35
Impactful Individual
6 years ago
Solved

Data overflow error when the "List.Accumulate" function was used to process data over 2000 rows

My Source Table:   Desired Table: Based on the Source Table, insert the missing "SN" with a value of 0, My M code as below: let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[...
  • Anonymous's avatar
    Anonymous
    6 years ago

    Curt Hagenlocher's argument   seems interesting to me.

    <<...

    But broadly speaking, M is a lazy language and some of the things you compute actually result in promises instead of immediate values. If the combination function passed to List.Accumulate results in a promise, then the result of accumulating over your list is a promise on top of a promise on top of... etc. At some point, when the actual value is calculated, it's done recursively -- the chain of promises is too long and the stack flows over.

    >>