Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Currency Converter

nischalvadari
6 - Meteoroid

I am trying to get the fx rates for the past 30 days. I want to set USD as the base and get the fx rates for all other currencies. I tried with the ECB repository, but it seems to have a very limited set of currencies. Can someone help with this, I am looking for daily fx rates for the past 30 days until today. Is there a way we can pull it from Google Finance or xe.com or other reliable sources?

 

Thanks in advance!

9 REPLIES 9
Luke_C
17 - Castor
17 - Castor

Hi @nischalvadari 

 

I usually find that yahoo finance has a good population, and it also has easily downloadable data so you don't have to constantly update your inputs. See attached as an example.

 

  1. In the text input, I put my currency pair (i.e. EURUSD).
  2. This feeds into a formula tool that populates the URL of the yahoo finance download link (equivalent to clicking the download button on this page)
  3. The download tool takes that link and downloads the data. In this case yahoo finance lets you download the last year of rates, but you can filter as needed once you have the data read in.
  4. The text to columns tools transform the data into a readable format, then the dynamic rename/select tool clean up the columns. 

 

Take a look and let me know if you have any questions.

 

Luke_C_0-1618837872473.png

 

 

 

nischalvadari
6 - Meteoroid

Thank you very much Luke. This was exactly what I was looking for. My input has a column with all the various currency codes. (sample shown below)

 

CountryCurrency
AfghanistanAFN
AlbaniaALL
AlgeriaDZD
Euro Member CountriesEUR
AngolaAOA
ArgentinaARS
ArmeniaAMD
ArubaAWG
AustraliaAUD
AzerbaijanAZN
BahamasBSD
BahrainBHD
BangladeshBDT
BarbadosBBD
BelarusBYN

 

Is there a way I can modify the workflow you had attached, so I can map the currency code and get the output as it was on your workflow? Also, how do I set the history to hold the past 30 days only (not that a longer history does any harm 🙂 )

 

 

Luke_C
17 - Castor
17 - Castor

Hi @nischalvadari 

 

What currency are you converting to? If it's USD you could just append USD to it (i.e. AFNUSD) and feed that into the formula tool.

 

For the dates, you can use a filter tool. You might have to make sure the date is in proper format first, but then you should be able to either select a date in the filter tool and do [Date]>= whatever date, or something more dynamic like: [Date]>= datetimeadd(Datetimetoday(),-1,'month') to just filter to the last month of dates. 

 

editing a bit. 

Luke_C
17 - Castor
17 - Castor

Here's a tweaked workflow that will show you some options for the filtering. Let me know what you think

nischalvadari
6 - Meteoroid

Thanks so much Luke. This is perfect! Just for an understanding, is there a way I can pull this information from a different source (xe.com or google finance or any other standard source that is widely used) and the tweak I would need to make in the URL to be able to pull exactly the way your workflow was performing. Thanks again.

Luke_C
17 - Castor
17 - Castor

Hi @nischalvadari 

 

It's very dependent on the site and how the data is stored there. I'm not as familiar with those sites, on first glance I didn't see any way to download the data, but I'd definitely suggest playing around with the tool and seeing if you can get it to work. 

 

If you're all set please accept the solution, otherwise let me know if there are other questions!

Alankrita-Shukla
5 - Atom

Hi @Luke_C

 

I used the workflow with 'https://query1.finance.yahoo.com/v7/finance/download/'+[Currency]+'=X?period1=1651108122&period2=168...' in URL column it is giving me correct value for INR only. If I have to convert AUD it is not giving me correct values. Am I using wong URL, if yes could you please help me with the correct one?

Luke_C
17 - Castor
17 - Castor

Hi @Alankrita-Shukla 

 

The data pulls from yahoo finance, so I'd check out what values are there. I've seen it struggle with some less common currency pairs. 

eahsanul
6 - Meteoroid

Hi Luke, 

 

the amounts i need to convert are in a different output, as the text input does not have any input anchor how can i ensure the data in my file get converted into USD currency

Labels
Top Solution Authors