Forum Discussion
jimmyhua
Helper I
1 year agouse List.Generate to create a conditional index gave me Expression.Error
I tried to create a conditional index for another list I created. here is the code I wrote and error I got. The first list is to create a position indicator where the index can began. The first one ...
- 1 year ago
use the below formula
let Source = {1,1,2,3,1,2,1,2,3,4,5,1,2,3,1,1,2}, Custom1 = List.Transform(List.Positions(Source), each if Source{_}=1 then _+1 else null) in Custom1result in
slorin
Super User
1 year agoHi jimmyhua
"here is sample list1, which represents a column in a table that I need to group. each 1 starts a new group."
You can use Table.Group directly
= Table.Group(
YourSource,
{"YourColumn"},
{{"Data", each _}},
GroupKind.Local,
(x,y) => Byte.From(y[YourColumn]=1)
)
Stéphane
jimmyhua
Helper I
1 year agowow. i have never used Table.Group function. this is eye opening for me. Thanks a lot.