Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
salto
Specialist II
Specialist II

Change currency symbol depending on variable value

Hello,

I have a variable (Currency) that lets me select to show the sales amount in € or $ in a chart.

It works fine, but, can I change the currency symbol in the charts? The number format pattern is set to €. So it is always showing €. Is it possible to change depending on the value of the Currency variable?

Many thanks in advance.

1 Solution

Accepted Solutions
boorgura
Specialist
Specialist

You can get the value of the selection into a variable (say vTemp)

then set the number format of that expression to "Expression Default"

In the expression use the num() function.

num(<expr>, '$(vTemp) #,##0')

Let me know if you have any questions.

View solution in original post

7 Replies
Not applicable

Hello,

on the Number Tab of a chart there is a 'Symbol' entry field. Here you can enter expressions to define the symbol shown on the axes.

hth,
Thilo

pover
Luminary Alumni
Luminary Alumni

You could get rid of the symbol in the number format and put the expression =only(Currency) in the Symbol field in the same tab.

Regards.

boorgura
Specialist
Specialist

You can get the value of the selection into a variable (say vTemp)

then set the number format of that expression to "Expression Default"

In the expression use the num() function.

num(<expr>, '$(vTemp) #,##0')

Let me know if you have any questions.

salto
Specialist II
Specialist II
Author

Thank you Thilo, Karl,

I have tried filling the Symbol field before posting, but had no result. I have tried with this expression:

=if($(Currency) = 'Euro', '€', '$')

It is showing nothing after the Sales Amount. Does it have any incorrection? Or do I have to select a Number Format other than Money?

Thanks again.

salto
Specialist II
Specialist II
Author

Thank you Rocky, it is a bit longer than filling the symbol field, but it works perfectly.

francesco_menin
Partner - Creator III
Partner - Creator III

The symbol field is not available in pivot / straight tables, so shouldn't it be done via the Num() func anyway?

Anonymous
Not applicable

Hi Rocky Could you please elaborate with an example, how to pass a variable from list box selections where it reflects in the chart

John