User Tools

Site Tools


currency_conversions

Using the real daily currency rate

1. Setup the connector url

It can look like this: https://connectors.windsor.ai/currency_conversion?fields=date,usdclp&api_key=<API_KEY>

Where in the above example: - USDCLP is the currency pair name from yahoo finance https://finance.yahoo.com/currencies?.tsrc=fin-srch - <API_KEY> is your API key from the onboard form

Test the URL in the browser to see its correct and shows you the data in JSON format.

2. Setup the data-transfer to your database.

In https://onboard.windsor.ai/ click destination tab and select windsor cloud database.

In connector url field enter the URL from step 1.

==== 3. Setup the new conversions

Go to https://charts.windsor.ai/w/sqllab/

Enter your queries for the currency conversion. In this example we convert the costs from CLP to USD with this query:

SELECT costs.date, SUM(costs.totalcost/currency_usdclp.usdclp::DECIMAL)
FROM costs
JOIN currency_usdclp  
ON TO_CHAR(costs.date, 'YYYY-MM-DD') = currency_usdclp.date
GROUP BY costs.date

You can then select to visualise the results and save them in your dashboard.

currency_conversions.txt · Last modified: 2021/12/28 19:30 by windsor_ai