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

Switching currencies

Hi all,

I have an app that is used both in the UK and the US. US customers want the revenues shown to be defaulted to USD, but UK customers want the default to be GBP. Using variables isn't working because sessions don't save variables, so the US users, once they open a new session, will keep seeing GBP. Is there another way around this using listboxes or something? Here is what the data looks like:

   

ClientRevenueGBPRevenueUSD
ABC13501000
3 Replies
avkeep01
Partner - Specialist
Partner - Specialist

Hi Sifat,

You could try section access. Then you can limited the data for the users. So if it is a US user, then only the currency USD is available, and the other way around for the UK.

And with that table you can make a pre selection which can be overruled by your original selection field. You simply could use; IF(GETSELECTEDCOUNT(OriginalCurrencyField)>0,OrgingalCurrencyField,NEW_CURRENCY);

Something like:

SECTION ACCESS;

Access:

LOAD

NTNAME,

ACCESS,

NEW_CURRENCY

INLINE [

NTNAME, ACCESS, CURRENCY

DOMAIN\USER_UK, USER, GBP

DOMAIN\USER_US, USER, USD

];

SECTION APPLICATION;

CurrencyTable:

LOAD

NEW_CURRENCY,

Rate

INLINE [

NEW_CURRENCY, Rate

USD, 1

UK, 0,745

];

sifatnabil
Specialist
Specialist
Author

Hi, while this is interesting, it's too rigid for our global company where some people work in locations like UK but are "American" and want to see USD, thus this is quite restrictive. The solution from John Witherspoon Switch between Multiple Currencies using a variable. Is there a better way? uses listboxes, however the data structure is different, i.e. there are different currencies on each row, whereas in my data, each currency is a column. Is there any listbox solution like John's?

avkeep01
Partner - Specialist
Partner - Specialist

Hi Sifat,

You could make the fieldnames dynamically like this;

assumption: your amount fields are name [AMOUNT USD] and [AMOUNT GBP]. the names you're using are probably differtent. I just choose a name.

- create a variable: vAmountColumn

LET vAmountColumn = IF(USERREGION='US',[AMOUNT USD], [AMOUNT GBP])

- Set exrpression with the help of vAmountColumn

$(=vAMountColumn)