Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[birt-dev] CheckIn:[131668] The function Total.percentile() works out the wrong result

- Summary:
Fix bugzilla bug 131668.


- Bugzilla Bug (s) Resolved:
[131668] The function Total.percentile() works out the wrong result


- Description:
Excel uses its own formula to calculate the percentile value. The formula can be explained by the following pseudocode:

 

 Say, if you want pct-th percentile from acading array a[],

 

       k=Math.floor((pct/4)*(n-1))+1)

   f=(pct/4)*(n-1))+1 - k; // We also need to calculate fraction:

   ad = a[k]+(f*(a[k+1]-a[k])) //Then we can calculate out the adjustment:

   result = a[k] + ad; //Finally we get the result.

 

The original implementation of percentile and quartile total function failed to comply with this rule.

 

The bug is fixed in source.

 

- Tests Description:
Unit test.


- Files Edited:
"/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/aggregation/rank/PercentileAccumulator.java"

 

"/org.eclipse.birt.data/test/org/eclipse/birt/data/engine/aggregation/TotalTest.java" 

 

- Files Added:

N/A


- Files Deleted:

N/A

 

- Notes to Build Team:
N/A


- Notes to Developers:
N/A


- Notes to QA: 
 

N/A

 

- Notes to Documentation:  
N/A

 

 

 

 

 

 

 

 


Back to the top