Forum Discussion
Set duplicate rows to 0 (NOT DELETE)
- 7 years ago
language version should not have any impact
this is the easiest way to do it
1) right click your original query, click Reference
2) go to the newly created query, go to Advanced Editor
3) remove last 2 rows4) add "," to the last row in the code
5) paste this code below the existing one
#"Added Index" = Table.AddIndexColumn(Source, "Index", 0, 1), #"Grouped Rows" = Table.Group(#"Added Index", {"Namefile", "Value"}, {{"Index", each List.Min([Index]), type number}}), #"Merged Queries" = Table.NestedJoin(#"Added Index",{"Namefile", "Index"},#"Grouped Rows",{"Namefile", "Index"},"Grouped Rows",JoinKind.LeftOuter), #"Expanded Grouped Rows" = Table.ExpandTableColumn(#"Merged Queries", "Grouped Rows", {"Value"}, {"NewValue"}), #"Removed Columns" = Table.RemoveColumns(#"Expanded Grouped Rows",{"Index"}), #"Sorted Rows" = Table.Sort(#"Removed Columns",{{"Namefile", Order.Ascending}}) in #"Sorted Rows"what happends conceptually is following:
1) add index to table2) group by Filename and Value with Index aggergated as MIN
3) reference the original query and merge with the grouped one on all 3 columns (this will require changing the code in the formula bar, as it is referencing step within same query)
4) expand the value column5) remove index
6) sort by filename
i have so many codes before this, i tried to copy this after all, but not worked, maybe because mine is in italian?
Can't u tell me step by step what to do without write code?
language version should not have any impact
this is the easiest way to do it
1) right click your original query, click Reference
2) go to the newly created query, go to Advanced Editor
3) remove last 2 rows
4) add "," to the last row in the code
5) paste this code below the existing one
#"Added Index" = Table.AddIndexColumn(Source, "Index", 0, 1),
#"Grouped Rows" = Table.Group(#"Added Index", {"Namefile", "Value"}, {{"Index", each List.Min([Index]), type number}}),
#"Merged Queries" = Table.NestedJoin(#"Added Index",{"Namefile", "Index"},#"Grouped Rows",{"Namefile", "Index"},"Grouped Rows",JoinKind.LeftOuter),
#"Expanded Grouped Rows" = Table.ExpandTableColumn(#"Merged Queries", "Grouped Rows", {"Value"}, {"NewValue"}),
#"Removed Columns" = Table.RemoveColumns(#"Expanded Grouped Rows",{"Index"}),
#"Sorted Rows" = Table.Sort(#"Removed Columns",{{"Namefile", Order.Ascending}})
in
#"Sorted Rows"what happends conceptually is following:
1) add index to table
2) group by Filename and Value with Index aggergated as MIN
3) reference the original query and merge with the grouped one on all 3 columns (this will require changing the code in the formula bar, as it is referencing step within same query)
4) expand the value column
5) remove index
6) sort by filename