Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
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