Forum Discussion
Removing duplicate data
- 8 years ago
In the query editor, you add an index-column:
Check the new index-column and sort descending:
Edit the formula in the formula bar to this (otherwise the sort-order will not be kept):
Check columns "Date" and "Art", and remove duplicates:
This is the code that you can paste into the advanced editor to follow the steps along:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Xc6xDcAgDETRXVyDZINBtCQhSyD2XyPWWXKR5opXnP7exJJZswxKJMy2k04yLsEFfDnX4Aq+nTVYwY9zC27g5dyDO/h1lt+JlZwP", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Date = _t, Sale = _t, Art = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Sale", Int64.Type}, {"Art", type text}}), #"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 1, 1), #"Sorted Rows" = Table.Buffer(Table.Sort(#"Added Index",{{"Index", Order.Descending}})), #"Removed Duplicates" = Table.Distinct(#"Sorted Rows", {"Date", "Art"}) in #"Removed Duplicates"
Kindly Tell me
Dear Xiaoxin Sheng,
How to apply these three steps...Kindly tell me
- ImkeF8 years agoCommunity Champion
In the query editor, you add an index-column:
Check the new index-column and sort descending:
Edit the formula in the formula bar to this (otherwise the sort-order will not be kept):
Check columns "Date" and "Art", and remove duplicates:
This is the code that you can paste into the advanced editor to follow the steps along:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Xc6xDcAgDETRXVyDZINBtCQhSyD2XyPWWXKR5opXnP7exJJZswxKJMy2k04yLsEFfDnX4Aq+nTVYwY9zC27g5dyDO/h1lt+JlZwP", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Date = _t, Sale = _t, Art = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Sale", Int64.Type}, {"Art", type text}}), #"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 1, 1), #"Sorted Rows" = Table.Buffer(Table.Sort(#"Added Index",{{"Index", Order.Descending}})), #"Removed Duplicates" = Table.Distinct(#"Sorted Rows", {"Date", "Art"}) in #"Removed Duplicates"- panipat19908 years agoHelper III
Hi,
When i load Next 4-Feb-2018 Value
Date Sale Art
4-Feb-2018 900 B
After Refresh it should be 900 Sale means update record..
But it is showing 200..you Sent me it is working only first row..But i want to update any row..Kindly Help Me
- panipat19908 years agoHelper III
Sorry It's Working.Thanks