Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QLIKWORLD LIVE! MAY 16 - 19TH, EARLY BIRD DISCOUNTS! REGISTER TODAY
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
Specialist III
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)

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)
PrashantSangle

Use ceil instead of round

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
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..

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)
Anil_Babu_Samineni

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

Capture.PNG

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)
marcus_malinow
Specialist III
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.