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: 
Anonymous
Not applicable

Variable as expression

Hi all,

I'm trying to use a variable as an expression.

It works but only half. Can anybody shed some light please?

I have a inputbox with predefined values only, being 'EUR' and 'Local'.

Whatever is selected in the inputbox, goes to a variable vCurrency.


I use the variable in another variable vCurrAmount.

In that variable I define the following:

if(vCurrency = 'EUR', [Amount EUR Curr], [Amount Transaction Curr])

In my chart, I use the variable vCurrAmount as expression.

sum($(vCurrAmount))

This works fine if in the inputbox the option 'EUR' is selected.

If I select the option 'Local', the expression doesn't work anymore.

I've tried a lot of different thing with $ signs and = marks.

Nothing seems to give me the correct result.

Many thanks in advance.

Evelien

1 Solution

Accepted Solutions
Nicole-Smith

What you currently have works fine for me (see attached).

If you are seeing something different, you will need to post a .qvw with that behavior.

View solution in original post

2 Replies
Nicole-Smith

What you currently have works fine for me (see attached).

If you are seeing something different, you will need to post a .qvw with that behavior.

Anonymous
Not applicable
Author

Nicole,

I tried the whole thing again in a different QVW and there it also works fine.

No idea why it doesn't work in the original file.

Thanks that you checked it for me.