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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Krish2459_58
Creator II
Creator II

dynamic currency conversion

Hi,

I need to do a dynaic currency conversion. In the attached data set there are two countires AUS and NZ. 

Requirement:

When AUD is the currency selected in the dashboard it should convert all NZ Product Rent from the file to AUD, and all Australian properties should display the identical figures to the data file. 

Then vice versa when NZD is selected it should show the exact figures from the data file for those NZ prodcuts and the Australian property figures should be converted to NZD via currency conversion.

 

Attached a sample file.

 

Labels (2)
2 Replies
Amit_Prajapati
Creator II
Creator II

Hi @Krish2459_58 , In this case, you can create a simple inline table with two columns: 'Currency Type' and 'Number', as shown below:

currency Type , Number

AUZ , 250

NZ , 120

Then, use the expression SUM(Sales) / Number in your calculation. Based on the selected currency type, the formula will dynamically adjust—for example, if 'AUZ' is selected, it will compute SUM(Sales) / 250;

if 'NZ' is selected, it will compute SUM(Sales) / 120

HirisH_V7
Master
Master

Hi Check below,

Here To will be your Currency filter. Also you can create these variables in script and use instead of only statement in below If snippet:

LET vAUD_to_NZD = Peek('Rate', FieldIndex('To', 'NZD') - 1, 'ExchangeRates') ;
LET vNZD_to_AUD = Peek('Rate', FieldIndex('To', 'AUD') - 1, 'ExchangeRates');
=If(
    GetSelectedCount(To) = 1 and GetFieldSelections(To) = 'AUD',
       Pick(Match(Currency,'AUD')+1,[Annual Rent] * Only({1<To={'NZD'}>} Rate),[Annual Rent]),
    If(
        GetSelectedCount(To) = 1 and GetFieldSelections(To) = 'NZD',
 Pick(Match(Currency,'NZD')+1,[Annual Rent] * Only({1<To={'AUD'}>} Rate),[Annual Rent]),
    // Default if no selection
    [Annual Rent]
    )
)

  

HirisH