Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to handle Currencies?

Hey guys, Im working on a applikation please find attached file.


I have a Currencies.QVD which I reload everyday. In This QVD everything si mapped to EUR which is = 1. So in my expressions I use turnover*rate_eur to make everything in EUR.


But I want to made turnover in USD also for example. How would that be done im sorry but I have really read the forums and can't seem to get it to work unfortunately 😕



6 Replies
luciancotea
Specialist
Specialist

Try to attach small examples, not the entire solution.

The standard way to hava a multi-currency application:

1. Create one 'SelectedCurrency'  variable where you list all the currencies you want. You use an InputBox to allow selection.

Let's say you have EUR and USD as options. And your exchange rate table have rate_EUR and rate_USD.

Other way is to have an isolated table in the data model that contains the currencies. You use a listbox to allow selection.

2. Create a 'CurrencyField' variable with the definition: ='rate_' & $(SelectedCurrency)

3. In your charts, use: =turnover * $(CurrencyField)

Not applicable
Author

I have a isolated table with currencies in relative to EUR which is set to 1. That's what I wanted to describe above.

So in expressions I calculate turnover by divide it to rate_eur to get everything in euros.

Not applicable
Author

luciancotea
Specialist
Specialist

All depends on the data model, not individual fields.

So, to use a listbox for currencies, you need a CurrencyExchangeRatesTable linked to your main transactions table by a YearMonth key (if you use monthly rates) or Date key (if you use daily rates)

The CurrencyExchangeRatesTable will have the following fields: YearMonth - Currency - Rate

Your main transactions table will have turnover expressed in EUR, therefore you will have the value '1' as exchange rate.

So, in the interface, use a ListBox (select 'Only one selected value') and you will use '=turnover * Rate' in your charts.

Not applicable
Author

I solved it by making a LOAD of the same currencytable but for one currency and one currency only in this case USD. then I go from Local Currency to EUR (that my db table is mapped to) and then from EUR to USD in the expression.

It might not be best practice but it works!

luciancotea
Specialist
Specialist

Of course it works

There are a lot of ways to achieve that.