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

Currency Conversions using variables

Hello,

I was wondering if anyone could help me create a variable which would allow me to switch between currencies on graphs? I have created a new column in my data source with the normal GBP amount as 1 and my USD convertor column as 1.55. I want to be able to create a variable so that I can click on a button and it will switch my close price of my graphs between USD and GBP?

Any help would be much appreciated.

Thanks

1 Solution

Accepted Solutions
petter
Partner - Champion III
Partner - Champion III

It is quite easy. You could create an INPUT BOX and when making it you create a variable that will be displayed in the INPUT BOX. Call the variable for instance vCurrRate.

Then you can input the currency conversion rate in that variable directly in the INPUT BOX.

Multiply the expressions in your charts where you want to be able to switch currencies by vCurrRate.

Sum( Sales ) * vCurrRate

This could be made more sophisticated by having a currency conversion rate table instead where you just select the currency in a LIST BOX and you have a predefined table of Currency, CurrRate and multiply by CurrRate just like the variable.

View solution in original post

4 Replies
petter
Partner - Champion III
Partner - Champion III

It is quite easy. You could create an INPUT BOX and when making it you create a variable that will be displayed in the INPUT BOX. Call the variable for instance vCurrRate.

Then you can input the currency conversion rate in that variable directly in the INPUT BOX.

Multiply the expressions in your charts where you want to be able to switch currencies by vCurrRate.

Sum( Sales ) * vCurrRate

This could be made more sophisticated by having a currency conversion rate table instead where you just select the currency in a LIST BOX and you have a predefined table of Currency, CurrRate and multiply by CurrRate just like the variable.

Not applicable
Author

Thank you so much Petter, that makes it very easy for me

petter
Partner - Champion III
Partner - Champion III

If my suggestion was the answer to your question could you please mark this question as answered?

pratap6699
Creator
Creator

let vrate=50(exchange rate); then as usual we load data then…main--newsheet obj--chart  straight-- dimension(year)--- expresion(sales)---finish..then; SETTINGS--VARIABLE OVERVIEW-- VARIABLE OVERVIEW WINDOW DISPLAYED--ADD--vcuràinr--OK.,,,need 2 extra buttons so…(1)mainànew sheet obj--button--text(inr)àaction tab---add--external--set   variable --OK. action tab--variable(vcur)-value(inr)--OK.(2) mainànew sheet objàbutton--text(GBR) ---action tab--add---external---set variable---OK.action tab --- variable(vcur)-value(GBR)--OK…right click on tablechart-- properties--- expressions  --- defination--- if(vcur=’inr’,sum(sales),sum(sales)*vrate)---OK---OK