Forum Discussion
gvg
Post Prodigy
5 years agoGet substring of every column in table
Hi folks, I am looking to figure out how to get a substring of every column in a table with a variable number of columns. My code looks like this but it is not working. It is expected to take a subs...
- 5 years ago
It's vital to understand use of different each and its different evaluation contextin in different functions.
let Source = myTable, myColumns = Table.ColumnNames(Source), Custom1 = List.Accumulate(myColumns, Source, (s,c) => Table.ReplaceValue(s, each Record.Field(_, c), each Text.Start(Text.From(Record.Field(_, c)), 3), Replacer.ReplaceValue, {c})) in Custom1
CNENFRNL
Community Champion
5 years agoIt's vital to understand use of different each and its different evaluation contextin in different functions.
let
Source = myTable,
myColumns = Table.ColumnNames(Source),
Custom1 = List.Accumulate(myColumns, Source, (s,c) => Table.ReplaceValue(s, each Record.Field(_, c), each Text.Start(Text.From(Record.Field(_, c)), 3), Replacer.ReplaceValue, {c}))
in
Custom1- gvg5 years ago
Post Prodigy
Yes, this works. Thank you !
What would you recommend to read about each? I find Microsoft documentation being very sparse.