Forum Discussion
Aligning / Carrying forward data in a table
- 2 years ago
Hi,
Edit 2nd step YourSource = Source and refer your data
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcvUNMDBU0lEy1PVKzNM1MgYyg3MzSzIUgkuKUlNLgFwFJKwUq4NVC0jONzEzryS/PI9I5SDsmlhcElySWJJKpHoQNjUwMMBU6paahFDqkZmegd8lvolFEOVOicnZRHnVsQCqwy+1nDQNIDmnzHT8DkJRDcLhqXiDBkM9CJvBgiYWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Employee = _t, #"Modification Date" = _t, Address = _t, Suburb = _t, State = _t, Zip = _t, Column1 = _t]), YourSource = Source, AddedSuburbSuffix = Table.TransformColumns(YourSource, {{"Suburb", each if Text.Trim(Text.From(_)) <> "" then Text.Trim(Text.From(_)) & ", " else "", type text}}), ReplaceBlankToNull = Table.TransformColumns(AddedSuburbSuffix, List.Transform(Table.ColumnNames(AddedSuburbSuffix), (colName)=> { colName, each if Text.Trim(_) = "" then null else Text.Trim(_), type text } ) ), ColNamesToFill = List.Buffer(List.Select(Table.ColumnNames(ReplaceBlankToNull), each not List.Contains({"Employee", "Modification Date"}, _))), StepBack = ReplaceBlankToNull, FilledDown = Table.FillDown(StepBack, ColNamesToFill), FilledUp = Table.FillUp(FilledDown, ColNamesToFill), #"Grouped Rows" = Table.Group(FilledUp, {"Employee", "Modification Date"}, {{"Address", each Text.Combine(Record.ToList(Table.Last(Table.SelectColumns(_, ColNamesToFill))), " "), type text}}) in #"Grouped Rows" - 2 years ago
Import your csv. Rename it to MyData. Then create blank query. Open Advanced Editor and replace whole code with the one I created. Close Advanced editor and edit 2nd step called YourSource.
Now it is = Source. Change it to = MyData
Hi dufoq3 and thanks for offering a solution.
I'm using a CSV file and I'm not sure if I'm copying the Source info correctly.
I get an error with the "let _t " part of the first line in your code above but I don't know Advanced Editor well enough to understand the error.
Can you use a CSV so I can understand how the Source info looks?
Thanks
Import your csv. Rename it to MyData. Then create blank query. Open Advanced Editor and replace whole code with the one I created. Close Advanced editor and edit 2nd step called YourSource.
Now it is = Source. Change it to = MyData