pinarello
Member
- Joined
- Jun 21, 2019
- Messages
- 218
- Reaction score
- 4
- Points
- 18
- Location
- Germany
- Excel Version(s)
- Office 365
Hello,
in a German forum, a questioner is looking for a VBA solution. But the problem could be solved very easily with Power Query, if there wouldn't be such a stupid error.
The spreadsheet "Target" contains a list with the key values "Text1" and "Text2", for which various data should be transferred from the spreadsheet "Source". If there are several values for the key combination Text1/Text2, the data of the most recent entry (column "Date") should be transferred.
So really a small thing for Power Query, if there wouldn't be this error.
I loaded the data of the spreadsheet "Source" into the connection "Table5" and filtered it to the values DE0010 and GEH209 (Text1). There are 2 entries for DE0010. The newest one shows the date 23.09.2019 (Sep 23). Where I have only set the filter so that the error becomes directly visible.
If I now form a join from "Merge1" (Table2 and Table3 of "Target") and "Table5", then the preview window of the query "Merge2" also shows me exactly the right data set to "DE0010", with the date 23.09.2019. in the step "Source". But if I now open the table in the next step "Expanded (0)", then the data of the record with the older date (July 25) are shown to me, which is not included in the connection "Table5".
Only if I go the detour to load the connection "Table5" as table, then load this as connection, and then in the query "Merge2" for the Join assign the new connection, the correct record is shown to me.
View attachment mof - 2 Tabellenblätter mit jeweils 2 Spalten vergleichen und kopieren (PQ) - en.xlsx
in a German forum, a questioner is looking for a VBA solution. But the problem could be solved very easily with Power Query, if there wouldn't be such a stupid error.
The spreadsheet "Target" contains a list with the key values "Text1" and "Text2", for which various data should be transferred from the spreadsheet "Source". If there are several values for the key combination Text1/Text2, the data of the most recent entry (column "Date") should be transferred.
So really a small thing for Power Query, if there wouldn't be this error.
I loaded the data of the spreadsheet "Source" into the connection "Table5" and filtered it to the values DE0010 and GEH209 (Text1). There are 2 entries for DE0010. The newest one shows the date 23.09.2019 (Sep 23). Where I have only set the filter so that the error becomes directly visible.
If I now form a join from "Merge1" (Table2 and Table3 of "Target") and "Table5", then the preview window of the query "Merge2" also shows me exactly the right data set to "DE0010", with the date 23.09.2019. in the step "Source". But if I now open the table in the next step "Expanded (0)", then the data of the record with the older date (July 25) are shown to me, which is not included in the connection "Table5".
Only if I go the detour to load the connection "Table5" as table, then load this as connection, and then in the query "Merge2" for the Join assign the new connection, the correct record is shown to me.
View attachment mof - 2 Tabellenblätter mit jeweils 2 Spalten vergleichen und kopieren (PQ) - en.xlsx
Last edited: