Forum Discussion
Dicken
1 year agoPost Prodigy
List Generate , how it iterates
Hi, I have a question regardign how gen accumulates , I have an accumulation which re starts when 10 is reached / exceeded, So this works, let alist = {3} & List.Repeat({2} , 25) in List.Gener...
- 1 year ago
As I wrote above: in that example you are never resetting y. So once y becomes greater than 10, y always remains greater than 10.
Therefore z will always be set to alist{x}
Omid_Motamedise
1 year agoSuper User
You can also solve this problem by List.Accumulate
let
alist = {3} & List.Repeat({2} , 25)
in
List.Accumulate(alist, {0},(a,b)=> if List.Last(a)+b>10 then a&{b} else a& {List.Last(a)+b})