Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
IMPORTANT security patches for GeoAnalytics Server available to download: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
BI_Dev
Creator
Creator

Variable issue in qliksense

Hi have Qlik variable set with values in Qlik sense app

ex: var1 - 10

       var2 - 20

       var3  20

in one text object I have var1+var2+var3 and output is 50

in another text object I have expression as if(var1+var2+var3 = 50,1,0) and the output I am getting is 0 where it should show 1 as output...not sure what is the issue.

Can anyone help me here .

Thanks much

6 Replies
Vegar
MVP
MVP

Try using parentheses around your expression

if((var1+var2+var3 )= 50,1,0)


Alternatively do an $ expansion on all vars

if(($(var1)+$(var2)+$(var3) )= 50,1,0)

BI_Dev
Creator
Creator
Author

I have tried this but doesnt work unfortunately !

kingsley101
Contributor III
Contributor III

Hi Supritha.

I would say that this is a problem with the declaration or calling of the variables.

Please use the dollar expansion:

=If($(var1)+$(var2)+$(var3)=50,1,0)

And also Declare the variables in the backend using:

LET var1 = 10;

Thanks

Kingsley

nsetty
Partner
Partner

can you add just var1+var2+var3 as an expression?  What value do you get

BI_Dev
Creator
Creator
Author

I get 50 but in If condition it shows False

Vegar
MVP
MVP

What is the result if you do this?

IF( [YourVar1-3Expression] = 50 , 1, [YourVar1-3Expression] )