Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Basic mathematics gives wrong result

can you try this in Qlikview text box and see what result you get. =If((2700/600000)*100<0.45,1)

I get 1, tried multiple versions.

2 Replies
Anil_Babu_Samineni

Because, We don't know whether how many decimals we get after that calculation. I know 1 is wrong in your case. Try some thing like below

=If((2700/600000)*100<0.45,1, 0)

I assume, this will return 1 because as i mentioned before line we are not understand the decimal point

=If(Ceil(2700/600000)*100<0.45,1, 0)

I assume, The calculation part is wrong it should return 0, Because now ceil() function can understand the decimal points where we are using calculation of %. If this condition returns 0 then the condition true

If you want, More information he will offer you better than me marcus_sommer

Meantime, go to help and check Round() and Ceil() functions to understand.

HTH

Anil

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
swuehl
MVP
MVP

Have a look at

Rounding Errors

In your case, you could try to multiply both sides of the equation with 100 and maybe add round to the left side (assuming that the numbers are not fixed, but part of e.g. an aggregation and right side is a constant threshold) to overcome this issue:

=((2700/600000)*100)*100 < 45

=Round(YourCalculation*100) < 45