Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Substitution of varables in an expression

Hello,

I have got the following expression in a text-field:

=count({<ValueType={'Count'}, Country={'Germany'}>} Value)

This works fine.

Now I want to make it flexible: Instead of 'Germany' I want to use a variable. This variable is set by a trigger from a field and a listbox.

If I choose France from the listbox I take this triffer:

Actions - Set Variable - Varible: Vcountry - Value: "'" & country & "'"

I tried the hints from the blog from Henric Cronstöm but with not success:

http://community.qlik.com/blogs/qlikviewdesignblog/2013/11/04/the-magic-of-variables

I tried to change 'Germany' into $(Vcountry) but it doesn't work.

Can anyone give me a hint?

Thanks

Klaus

Tags (2)
3 Replies
MVP
MVP

Re: Substitution of varables in an expression

field names are case sensitive, so shouldn't it be upper case?

=chr(39) & Country & chr(39)


If possible, create and post a small sample app.

Not applicable

Re: Substitution of varables in an expression

Thanks, the hint with chr(39) is great!

Now I've got a variable Vcountry with 'France'.

How do I get this Vcountry into my expression?

, Country={$(Vcountry)}, doesn't work.

MVP
MVP

Re: Re: Substitution of varables in an expression

Not sure why it does not work. It would be easier if you could provide a small sample application.

Like attached..,

Community Browser