Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
venky77777
Contributor III
Contributor III

converted 2 decimal point number creating wrong result at calculation

In qliksense I converted val1=0.00000052 to 0.00 and val2=0.00000045 to 0.00 using num(). but when I apply condition in table that if(val1=val2,green(), red()), I'm getting only red color. After converting both are 0.00 but not getting green color.

Labels (2)
1 Solution

Accepted Solutions
PhanThanhSon
Creator II
Creator II

Hey,

The `num` function is a display function and doesn't transform your data; you would indeed need a `floor` or `round` function to compare your numbers to specific decimal places accurately.

best regards Son

View solution in original post

3 Replies
PhanThanhSon
Creator II
Creator II

Hey,

The `num` function is a display function and doesn't transform your data; you would indeed need a `floor` or `round` function to compare your numbers to specific decimal places accurately.

best regards Son

venky77777
Contributor III
Contributor III
Author

thanks for reply, now got result. but getting problem when comparing 2 values like v1= -0.3 andv2= -0.4 both are getting equal as round converting as 0.00, but I want separate colors when I apply if(round(v1)>=round(v2), red(),green()) .

PhanThanhSon
Creator II
Creator II

Hi,

you need to round like this:

PhanThanhSon_1-1710512151858.png

Best regards Son