Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Knowledge Base

Definitive answers from Designer Desktop experts.

Currency Converter

TonyM
Alteryx Alumni (Retired)
Created

Tired of pulling conversion rates manually? Me too!

 

Let’s build ourselves a currency converter in Alteryx Designer version 10.1 using the http://fixer.io/ exchange rates. Fixer.io is a free JSON API for current foreign exchange rates published by the European Central Bank. The rates are updated daily around 3PM CET.

 

The first thing we will do is gather the API documentation from the Fixer.io website. This will give us the URL we need to make our REST API call. If you are unfamiliar with making REST calls please take a look at Tasha’s

Attachments
Comments
arnold_slabbekoorn
7 - Meteor

Tony, great post. In the URL I noticed you can also add a date to get historical rates for that day. What I tried to do is add a date input and Value replace on the URL for that date field 2015-02-01 for instance is my default in the URL. Hower I can't seem to replace the date similar to you are replacing the base value. Any idea how to do this with a calendar tool?

TonyM
Alteryx Alumni (Retired)

 Hi Arnold,

 

Awesome suggestion!

 

I've managed to get the URL that can handle historical rates. From the example above, the text input URL would change to http://api.fixer.io/2016-01-20?base=USD. This link will pull the rates for today (latest) and a Calendar interface tool will allow a selection of historical dates.

 

calendar int.png

 

In the action tool for the calendar I am updating the value for the date string via the calendar selection.

 

calendar.png

 

Best,

Mitchell_G
7 - Meteor

This is amazing! I'm looking to see if something similar exists for Weight Unit conversion. LBS to KG or Tons etc. It should be even easier as these conversions never change unlike exchange rates.

ckjcheung
5 - Atom

Hi Tony, 

 

Would you be able to upload the version with the calendar allowing you to pull historical rates?  Much appreciated!!!

 

Jason

TonyM
Alteryx Alumni (Retired)

Hi @ckjcheung,

 

I have uploaded the version that can pull historical rates. Please let me know if this is the solution you were looking for!

 

Best,

ckjcheung
5 - Atom

Hi Tony,

 

Thanks for the prompt reply!   It's very close to what I am looking for and I am wondering if you can show me one step further.   Using your tool right now, I can only specify one date during each run.  Is it possible to have it pull multiple dates?   Let's say 2014-1-1 to Today?   Can we specify whether we want daily or weekly rates?  

 

Sorry for all the questions. This is an awesome tool and will be very helpful if it can do that.   

 

Thanks again!

TonyM
Alteryx Alumni (Retired)

I've updated the macro to pull results from a given date or date range now @ckjcheung. Thanks again for the suggestion. May I ask how you are utilizing the macro? I'd like to hear about how it is being deployed.

ckjcheung
5 - Atom

Hi Tony, 

 

Thanks for uploading the tool.   I work in Asia and my company need to deal with multiple currencies (RMB, JPY, KRW, HKD...) and need to be able to convert them back to USD based on the weekly  rates.  I need to be able to pull weekly exchange rate data so the weekly report I do can reflect the latest currency exchange effects.   I had to manually copy and paste data from websites before.   

 

Thanks again Tony! 

FilipIsai
5 - Atom

Hi guys,

 

I'm a beginner with Alteryx, and I'm trying to use this macro to do a dynamic fx conversion for a weekly report I'm running, but it doesn't have any output for me, what am I doing wrong?

 

I am connecting it to the workflow, and giving it input a column of integers, the amount I want to convert in USD from EUR, and setting the calendar date for today.

 

Anything else I need to know?

 

Thanks and regards,

Filip

 

princejindal
9 - Comet

Hi Tony,

 

I have been using your macro since last month, and it worked really well; however, today it threw error '404'. The fixer link doesn't seem to be working. I created my ID on fixer.io and used the "Historical endpoint link", but I am not able to change the base currency. It would be great if you can help me fix this.

 

Thanks,

Prince 

jasoncheung
5 - Atom

It seems like the free account restricts your base currency to EUR.  They require you to pay a subscription if you want to change to other base currencies.   This is annoying...

princejindal
9 - Comet

Yes I realised that I would need atleast a basic subscription. But since I was dealing with only historical currency rates, I created a historical currency rates database and used that to build a currency conversion macro.

 

 

drew9
9 - Comet

Hello fellow Alteryx users,

 

I came across this post and discovered the macro does not fully work anymore as fixer.io now requires a subscription and have deprecated the endpoint this macro is using. But fear not! If you go into the formula tool in the macro and open up the box where it sets the "URL" column, you can change the url to be "https://api.exchangeratesapi.io/"+[Date]+"?base=USD" and the macro will work 100% as expected! This api endpoint is open source and requires no subscription. Hope this helps anyone with the same problem as me!

Data_Alter
8 - Asteroid

Hi @drew9 , I changed the URL column but it isn't working for me. Please can you share your updated Macro

drew9
9 - Comet

@Data_Alter Hello, I just checked this and unfortunately it seems like this is no longer free and open source. You can probably still get it to work but it will require a subscription and adding in your access key to the URL column appropriately. Sorry :/