Forum Discussion
Dicken
Post Prodigy
23 days agoinsert values in nested lists except last
I want to insert rows into a list / table , i have used lists here for clarity, but not the last so { { 1,2,3}, {1,2,3} , { 1,2,3} } = { 1,2,3,"X"} , {1,2,3,"X"} , {1,2,3}} I have two meth...
- 22 days ago
Another solution
= List.ReplaceValue(
List.RemoveLastN(Source,1) ,
each _ &{"X"},
null,
(x,y,z)=>y(x))
& List.LastN(Source, 1)Stéphane
slorin
Super User
22 days agoHi,
= List.Transform(
List.Zip({
alist,
List.Repeat({{"X"}}, List.Count(alist)-1) & {{}} }),
List.Combine)
Stéphane
slorin
Super User
22 days agoTo avoid adding a "null" to the last item
= List.Transform(
List.Zip({
List.RemoveLastN(Source, 1),
List.Repeat({{"X"}}, List.Count(Source)-1)}),
List.Combine)
& {List.Last(Source)}