Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Mapping currency exchange

Hello,

I was wondering if someone can help me.

I currently have a data base, with information about different purchases.

Heres an exmaple of the relevant information.

IDDateAmountCurrency
101/01/2015120CAD
205/01/2015500EUR
306/01/2015336SGD
402/02/20151587EUR
520/01/2015542GBP
631/01/201524CAD
705/02/2015126GBP

Besides i have a data base, that has the currency rate per month. It turn everything to dollars. Here is and example:

Currency1Currency2DateExchange rate
CADUSD01/20151.243
EURUSD01/20150.913
CADUSD02/20151.256
EURUSD02/20150.911

Here i just showed an example, but both data bases are bigger, and the point is i need to report all my results on USD.

Si i was wondering how i can create an additional field on my first db, so i can add the exchange rate for that purchase.

I need to map this using the date (that is only by month) and the currency.

Is there a way to do this??

I cant just add em and use a sync table because of other elements on the application.

Im looking for a solution inside the loading code.

thanks,

Labels (1)
1 Solution

Accepted Solutions
Not applicable
Author

Try this:

Temp:

LOAD      ID,

                Date,

                Amount,

               Currency

FROM

     Table1;

INNER JOIN (Temp)

LOAD

     Currency1 AS Currency,

     Date,

     [Exchange rate]

FROM

     Table2;


Regards!

Marcos Freire

View solution in original post

2 Replies
Not applicable
Author

Try this:

Temp:

LOAD      ID,

                Date,

                Amount,

               Currency

FROM

     Table1;

INNER JOIN (Temp)

LOAD

     Currency1 AS Currency,

     Date,

     [Exchange rate]

FROM

     Table2;


Regards!

Marcos Freire

swuehl
Champion III
Champion III

You can create a field in your first table to repesent the month, with the same value format as in the second table, maybe like

FACT:
LOAD *,

     Right(Date, 7) as Month

RESIDENT YourFirstTable;

LEFT JOIN (FACT)

LOAD Currency1 as Currency,

           Date as Month,

          [Exchange Rate]

Resident YourExchangeRateTable;

DROP FIELD Month;