deLockloire
Board Regular
- Joined
- Apr 4, 2008
- Messages
- 116
- Office Version
- 365
- Platform
- Windows
Hi,
I'm importing an .xml containing exchange rates from the ECB website. The result of that import is a data structure like this:
However, I'd like to transform this during the import so that each currency gets their own column. Like this:
Unfortunately, not every currency has values for every date. So it might be the case that for Currency1, the whole Date1 row is missing. In such cases, I'm okay if the exchange rate is left blank or filled with the last value if there is one before that. Can this be done in one fell swoop in Power Query?
Thanks for any input!
deL
I'm importing an .xml containing exchange rates from the ECB website. The result of that import is a data structure like this:
DATE | Exchange Rate | Currency |
Date1 | Currency1 Exchange Rate 1 | Currency1 |
Date2 | Currency1 Exchange Rate 2 | Currency1 |
Date3 | Currency1 Exchange Rate 3 | Currency1 |
Date1 | Currency2 Exchange Rate 1 | Currency2 |
Date2 | Currency2 Exchange Rate 2 | Currency2 |
Date3 | Currency2 Exchange Rate 3 | Currency2 |
Date1 | Currency3 Exchange Rate 1 | Currency3 |
Date2 | Currency3 Exchange Rate 2 | Currency3 |
Date3 | Currency3 Exchange Rate 3 | Currency3 |
However, I'd like to transform this during the import so that each currency gets their own column. Like this:
DATE | CURRENCY1 | CURRENCY2 | CURRENCY3 |
Date1 | Currency1 Exchange Rate 1 | Currency2 Exchange Rate 1 | Currency3 Exchange Rate 1 |
Date2 | Currency1 Exchange Rate 2 | Currency2 Exchange Rate 2 | Currency3 Exchange Rate 2 |
Date3 | Currency1 Exchange Rate 3 | Currency2 Exchange Rate 3 | Currency3 Exchange Rate 3 |
Unfortunately, not every currency has values for every date. So it might be the case that for Currency1, the whole Date1 row is missing. In such cases, I'm okay if the exchange rate is left blank or filled with the last value if there is one before that. Can this be done in one fell swoop in Power Query?
Thanks for any input!
deL