Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Highlighted
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
Highlighted

Re: Basic mathematics gives wrong result

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

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
MVP
MVP

Re: Basic mathematics gives wrong result

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