Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
baldwin79
Contributor
Contributor

QlikView Ranking Giving Incorrect Results

Hi All,

There is an issue with the ranking based on the data we have. Below is the data.

LOAD * INLINE [
DIM, AMT
A, 276880.64
B, 276880.64
C, 34610.08
C, 34610.08
C, 34610.08
C, 34610.08
C, 34610.08
C, 34610.08
C, 34610.08
C, 34610.08

];

 

When adding this calculated dimension into the chart, it give incorrect results to the ranking, suppose A,B,C should be rank as 1 because the total amount by DIM is the same amount but it ranked C as 1 and A,B as 2.

=aggr(Rank(Sum(AMT),4,1),DIM)

1 Solution

Accepted Solutions
tresesco
MVP
MVP

This is because of the precision issue of floating point numbers. If you expand your decimal precision, you would see all numbers are NOT same. 

Untitled.png

That's why it is said you must be very careful when comparing (ranking comes after comparing) decimal values in computer world because of it's binary representation issue. 

For better understanding have a look here: https://community.qlik.com/t5/Qlik-Design-Blog/Rounding-Errors/ba-p/1468808 

View solution in original post

4 Replies
baldwin79
Contributor
Contributor
Author

Hello, any solutions for this? Or it is a well known bug for QlikView?

alex00321
Creator II
Creator II

Good question, mark here waiting some expert on it. Thanks!

baldwin79
Contributor
Contributor
Author

Hi,

is this only happen to qlikview but not qliksense?

tresesco
MVP
MVP

This is because of the precision issue of floating point numbers. If you expand your decimal precision, you would see all numbers are NOT same. 

Untitled.png

That's why it is said you must be very careful when comparing (ranking comes after comparing) decimal values in computer world because of it's binary representation issue. 

For better understanding have a look here: https://community.qlik.com/t5/Qlik-Design-Blog/Rounding-Errors/ba-p/1468808