Forum Discussion
ReplaceValue of each Table Record
- 1 year ago
Kind of tough since you force someone to create an example and don't show desired results. Hopefully I have understood you well enough that you can adapt this code to your real problem.
BTW, I really don't understand your stated logic. An example of before and after would clarify that, but you can probably change the logic in the code below to suit your requirements.
Your file is not useful since the data source is not included.
But try something like the code below, which will transform each table in your column of tables before you expand them:
Before:
let //Replace Source with your table that has a column populated by Tables Source = Table.FromColumns({{Table9,Table10,Table11}}, type table[Table=table]), //Transform each table according to your stated logic //you may need to modify this as I probably mis-understood what you require replace = Table.TransformColumns(Source,{ {"Table", (t)=>Table.ReplaceValue( t, each [Full Description], null, (x,y,z)=>List.Skip(Text.Split(y,"-"),2){0}, {"Full Description"}) } }) in replaceAfter:
Kind of tough since you force someone to create an example and don't show desired results. Hopefully I have understood you well enough that you can adapt this code to your real problem.
BTW, I really don't understand your stated logic. An example of before and after would clarify that, but you can probably change the logic in the code below to suit your requirements.
Your file is not useful since the data source is not included.
But try something like the code below, which will transform each table in your column of tables before you expand them:
Before:
let
//Replace Source with your table that has a column populated by Tables
Source = Table.FromColumns({{Table9,Table10,Table11}}, type table[Table=table]),
//Transform each table according to your stated logic
//you may need to modify this as I probably mis-understood what you require
replace = Table.TransformColumns(Source,{
{"Table", (t)=>Table.ReplaceValue(
t,
each [Full Description],
null,
(x,y,z)=>List.Skip(Text.Split(y,"-"),2){0},
{"Full Description"})
}
})
in
replace
After:
Result is what I want.
Thank you!