Hi all, please help to resolve the following issue.
I Have a very huge dataset showing the following and I need to fill the column "Currency 2/ USD" with values:
# Time; Cur 1; Cur 2; Pair; Price; Currency 2/USD
1 2:00 pm EUR ; USD; EUR/USD 1,165 1
2 5:00 pm EUR ; USD; EUR/USD 1,167 1
3 5:01 pm UAH ; EUR; UAH/EUR 0,032 1,167
4 5:02 pm UAH ; EUR; UAH/EUR 0,031 1,167
5 5:03 pm EUR ; USD; EUR/USD 1,169 1
6 5:06 pm UAH ; EUR; UAH/EUR 0,031 1,169
So the logic of filling the column "Currency 2 / USD" is the following: If Currency 2 is USD then return 1, if it is not USD (let's say EUR like in line 3), look for the most recent this currency / USD price and state it (1,167 for lines 3 and 4 as the most recent EUR/USD is line 2 with price 1,167).
How should I do this? P.S. I have 67 unique pairs