Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

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

Re: Integer comparisons on Variables not working

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

Community Browser