Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Neymar_Jr
Creator II
Creator II

Error with the result of IF() used in script.

Hi Guys,

I am using an if statement in statement which shows the wrong result.

The if statement that i have used is as follows -

if(x<z or y<z,'x or y< z',

if(x>z or y>z,'x or y> z','x or y = z')) as "xyzpap".

But when i use it to create a pie-chart -

1) "xyzpap" as Dimension

2) Sum(values).

It gives wrong values for 'x or y<z', 'x or y >z' and 'x or y = z'.

How  do i tweak the expression to get the correct result?

3 Replies
shraddha_g
Partner - Master III
Partner - Master III

It doesn't seem any issue with expression you have used.

If possible share screenshots of what you have done or Sample app

Neymar_Jr
Creator II
Creator II
Author

I got it...it was silly on my part to post it here

The difference in result of excel file and that of qlik was because in excel the value of x,y and z were rounded-off.

And that resulted in different results!


Cheers!

shraddha_g
Partner - Master III
Partner - Master III

That's Good!