Forum Discussion
dogburalHK82
3 years agoHelper III
merge multiple rows with condition
Hi, I have a raw table from ERP and they are multiple rows having the same PO no. as well as part number (or PO line no.). Now I would like to merge those into one single row, I wonder how I c...
- 3 years ago
Hello, dogburalHK82 if you need the very last record per each PO and item then try this
let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content], idx = Table.AddIndexColumn(Source, "idx", 1, 1, Int64.Type), f = (t as table) as record => Record.RemoveFields(Table.Last(Table.Sort(t, "idx")), "idx"), group = Table.Group(idx, {"Purchase Order", "Item Number"}, {{"all", each f(_), type table [idx=number]}}), z = Table.FromRecords(group[all]) in z
AlienSx
3 years agoSuper User
but how Receipt Qty became equal to 1274 in PO222? It depends upon backorder qty? It's still unclear.
dogburalHK82
3 years agoHelper III
That is becase we had partially received the parts in the previous month. For this case, we need to calculate the total receipted qty based on backorder quanty and qty ordered.