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

Translate expression to variable

How come

=IF(System_1 = System_2, '1', '0')

returns 1 when the fields are equal if I use it in an expression, but returns 0 if I create a variable out of it vSystem_Match and put that in my chart as either a dimension or an expression? (With $ expansion)

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try defining your variable like

if(System_1 = System_2,'1','0')

i.e. without the equal sign. There is a more than subtle difference in using the equal sign and not using it

(see also http://www.qlikfix.com/2011/06/08/not-all-variables-are-created-equal/ )

Then reference the variable in your expression like:

=$(vSystem_Match)

Hope this helps,

Stefan

View solution in original post

2 Replies
swuehl
MVP
MVP

Try defining your variable like

if(System_1 = System_2,'1','0')

i.e. without the equal sign. There is a more than subtle difference in using the equal sign and not using it

(see also http://www.qlikfix.com/2011/06/08/not-all-variables-are-created-equal/ )

Then reference the variable in your expression like:

=$(vSystem_Match)

Hope this helps,

Stefan

Anonymous
Not applicable
Author

Thank you Stefan!

Jonathan