Forum Discussion
Merging queries - incorrect value after expand table
Sure,
let
Źródło = Table.NestedJoin(#"Calesco PO - ilość szt >0", {"PO & PO line ID"}, #"SO OBR - ilość szt >0", {"PO & PO line ID"}, "SO OBR - ilość szt >0", JoinKind.LeftOuter),
#"Przefiltrowano wiersze" = Table.SelectRows(Źródło, each ([Purchase order] = "123744")),
#"Usunięto inne kolumny" = Table.SelectColumns(#"Przefiltrowano wiersze",{"Vendor account", "Purchase order", "PO line ID", "PO & PO line ID", "Delivery date ", "SO OBR - ilość szt >0"})
in
#"Usunięto inne kolumny"
Hi szczepaneq ,
Is there a reason why you're doing row filters and column selection before expanding your merge?
I'm not sure whether this would actually cause a problem, but it seems unorthodox to do things this way round.
What happens if you apply this code to a new blank query?
let
Źródło = Table.NestedJoin(#"Calesco PO - ilość szt >0", {"PO & PO line ID"}, #"SO OBR - ilość szt >0", {"PO & PO line ID"}, "SO OBR - ilość szt >0", JoinKind.LeftOuter),
expandMerge = Table.ExpandTableColumn(Źródło, "SO OBR - ilość szt >0", {"PO & PO line ID", "Data dostawy"}, {"PO & PO line ID_2", "Data dostawy_2"}),
#"Przefiltrowano wiersze" = Table.SelectRows(expandMerge, each ([Purchase order] = "123744")),
#"Usunięto inne kolumny" = Table.SelectColumns(#"Przefiltrowano wiersze",{"Vendor account", "Purchase order", "PO line ID", "PO & PO line ID", "Delivery date ", "SO OBR - ilość szt >0"})
in
#"Usunięto inne kolumny"
Pete
- szczepaneq4 years agoRegular Visitor
I did some filters to describe simple example. Without any filters, I have the same result. (correct value before expand, and another one - incorrect after expand).
before expand:
after:
- bsssss2 years agoNew Member
Hello!
Did you find any solution? I'm having the same error and I'm going crazy 🙂
- mjeason1211 months agoNew Member
I remember seeing a solution somewhere else for this problem and it involved wrapping the original table in a buffer (Table.Buffer()) when merging the two (before expanding). Seemed to work for me.