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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Integer comparisons on Variables not working

Hi,

I'm currently using some variables in my chart expressions and they don't seem to be working at all.

The expression essentially says:

if (variable = x[where x is just an arbitrary integer], result1, result2)

When I use the variable, it never resolves properly, and always defaults to the "else" path in the if statement, even when I know it should work.

However, if I simply copy and paste the contents of the variable into the script itself, it works perfectly.

This is leading me to believe that Qlik Sense is improperly running the comparison on the variables. It should be, I assume, comparing the value that the variable returns, but somehow isn't.

Am I way off? Has anyone else ran into this issue? Any ideas how to resolve this? This is very frustrating because it seems to me that variables aren't doing the exact thing that I would have thought they're meant to do.

Thanks,

Chris

1 Reply
Not applicable
Author

I managed to figure it out.

I wasn't encompassing my variables in $() so they were resolving to strings rather than their computed values.

Thanks,

Chris