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

Inconsistent Rounding results in qlikview

The below script is returning different rounding results. However I am expecting the result to be 0.7767 in place of IncorrectRoundResult column. How can this be fixed without using CEIL?

RoundData:

LOAD

round(Num1/Num2,0.0001) as IncorrectRoundResult,

Num1/Num2  as  NoRoundResult,

round(0.77665,0.0001) as CorrectRoundResult;

LOAD* INLINE

[

Num1, Num2

978579,1260000

]

;

1 Solution

Accepted Solutions
marcus_malinow
Partner - Specialist III
Partner - Specialist III

How about this?

A bit kludgy, but it works.

round(round(Num1/Num2, 0.00001),0.0001) as CorrectRoundResult,

View solution in original post

9 Replies
sunny_talwar

Look at this thread

Rounding Errors

Anil_Babu_Samineni

This should return =Round(978579/1260000,0.0001)

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
PrashantSangle

Use ceil instead of round

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

I need to use the column names but not the actual values. When the actual values are used, it provides correct intended result

Not applicable
Author

Ceil has issues like it would return 0.7666 for ceil(0.76653,0.0001)

Anil_Babu_Samineni

Sunny already provide nice article. You can look diff of Floor and Ceil..

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
Anil_Babu_Samineni

From Sunny provided link, i used ceil to get into work

Capture.PNG

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
marcus_malinow
Partner - Specialist III
Partner - Specialist III

How about this?

A bit kludgy, but it works.

round(round(Num1/Num2, 0.00001),0.0001) as CorrectRoundResult,

Not applicable
Author

Thank you Marcus. It worked.