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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to change from one currency to another currency

Hi all,

in my datasource i have amount in two currencies.in column amountusd,value is in usd and in column amount value in local.

now i should filter with local and usd .if user selects usd amountusd should be displayed .if local is selected amount should be displayed .

i creared inline table with field  currency and with usd and local as values.

then i created 2 variables.

vcurrency=minstring(currency)

field=if(vcurrency='usd',amountusd,amount)

and in expression i have written sum({<flag='Y'>}$(field))

i am getting errror..

Please suggest.

thanks in advance.

6 Replies
awhitfield
Partner - Champion
Partner - Champion

Hi Charan,

see the example attached

1. Created variable v_currency = 1

2. Button toggles the variable value between 0 and 1

3. Chart expression = If(v_currency =1,sum(amount),sum(amountusd))

ashfaq_haseeb
Champion III
Champion III

Hi,

Check this

Currency Conversion

Regards

ASHFAQ

Not applicable
Author

Hi Andrew,

to avoid if condition in expression i created varaibles .i dont want to use if in exprssion .

thanks..

awhitfield
Partner - Champion
Partner - Champion

Ok move the 'if statement' to a variable and just $ expand the variable as your expression.

Andy

Not applicable
Author

i have written this way

vcurrency=minstring(currency)

field=if(vcurrency='usd',amountusd,amount)

and in expression i have written sum({<flag='Y'>}$(field))

but i am gettinf error

awhitfield
Partner - Champion
Partner - Champion

Can you post an example of your qvw, not sure what <flag='Y'> refers to?

Andy