Forum Discussion
Anonymous
4 years agoNot applicable
Hi guys,need help in tranform the data.
Input:
| Product | Activity |
| P1 | A1 |
| p2 | A1 |
| p3 | A2 |
| p1 | A2 |
| p2 | A3 |
| p3 | A3 |
expected output:
| P1 | A1 | P2 |
| P1 | A2 | P3 |
| p2 | A3 | p3 |
- Anonymous4 years ago
Hi Anonymous
What is the logic? Made a guess...
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCjBU0lFyNFSK1YlWKjBCYhuD2EYQtiESG6zGGEkNkB0LAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Product = _t, Activity = _t]), #"Merged Queries" = Table.NestedJoin(Source, {"Activity"}, Source, {"Activity"}, "all", JoinKind.LeftOuter), #"Added Custom" = Table.AddColumn(#"Merged Queries", "Custom", each if List.Max( [all][Product])>[Product] then List.Max( [all][Product]) else null), #"Filtered Rows" = Table.SelectRows(#"Added Custom", each ([Custom] <> null)), #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"all"}) in #"Removed Columns"
2 Replies
- AnonymousNot applicable
Hi Anonymous
What is the logic? Made a guess...
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCjBU0lFyNFSK1YlWKjBCYhuD2EYQtiESG6zGGEkNkB0LAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Product = _t, Activity = _t]), #"Merged Queries" = Table.NestedJoin(Source, {"Activity"}, Source, {"Activity"}, "all", JoinKind.LeftOuter), #"Added Custom" = Table.AddColumn(#"Merged Queries", "Custom", each if List.Max( [all][Product])>[Product] then List.Max( [all][Product]) else null), #"Filtered Rows" = Table.SelectRows(#"Added Custom", each ([Custom] <> null)), #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"all"}) in #"Removed Columns"- AnonymousNot applicable
Thanks Anonymous for quick response.will check this and update you.thanks again .