Tag not monitored by Microsoft.
List.Accumulate iterates over the items in the list to compute its result (which in your case happens to be a list). It's this inner iteration that is throwing the error, not the iteration done by List.First.
Ehren
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Why I have an error here?
List.First(List.Accumulate({1, 2 / "f"}, {}, (v,i)=> v & {i}))
PQ is lazy and provides streaming semantics for lists, and the source for List.First (1) is a list (List.Accumulate... (2)). So,
A) due to streaming semantics, if 1 gets the first element of 2, execution of 2 should stop;
B) due to laziness, the calculation of the second list element of 2 shouldn't happen before any call for it.
So we should not get the error here...
And in this case, all is OK:
List.First(List.Select({1, 2 / "f"}, each _ > 0))
And I'm sure that in the case of List.Generate all will be OK either.
Tag not monitored by Microsoft.
List.Accumulate iterates over the items in the list to compute its result (which in your case happens to be a list). It's this inner iteration that is throwing the error, not the iteration done by List.First.
Ehren