Forum Discussion
LucileD
1 year agoFrequent Visitor
replacing value dynamic column Table.ReplaceValue
Hi all, I am trying to replace blank cell by a Y but the column I want to do this replacement is contained into each of my Section cell ( dynamic). In my original file I have around 3-4000 row, and ...
- 1 year ago
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCjY0VdJRigRiGBWrAxI1gnKhMlBRY/1gQxNUmUiYFE5jMEwxhfJQTEYViwUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Section = _t, S12 = _t, S13 = _t, S14 = _t, S15 = _t]), Result = Table.FromRecords(List.Transform( Table.ToRecords(Source), (row) => List.Accumulate( Text.Split(row[Section], "/"), row, // [A = 1, B = 2] & [A = 5] => [A = 5, B =2] // [B = 2] & [A = 5] => [A = 5, B =2] (s, v) => s & Record.AddField([], v, "Y") ) )) in Result
LucileD
1 year agoFrequent Visitor
Perfect, thanks a lot ... just .. can I Know what the comment mean exactly ?
// [A = 1, B = 2] & [A = 5] => [A = 5, B =2]
// [B = 2] & [A = 5] => [A = 5, B =2]#noob
ZhangKun
1 year agoSuper User
https://learn.microsoft.com/en-us/powerquery-m/m-spec-operators#record-merge
[] & [A = 1] => [A =1]
[A =2] & [A =1] => [A = 1]