[Libreoffice-bugs] [Bug 112326] New: Average of column gets thrown off by boolean values

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Mon Sep 11 13:03:19 UTC 2017


https://bugs.documentfoundation.org/show_bug.cgi?id=112326

            Bug ID: 112326
           Summary: Average of column gets thrown off by boolean values
           Product: LibreOffice
           Version: 5.2.7.2 release
          Hardware: Other
                OS: Mac OS X (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Calc
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: michaelviveros at gmail.com

Description:
I have a pivot table based off a table with 3 columns: Date, Value, Is_Weekday.
Is_Weekday is a boolean column. Value is just an arbitrary number. The pivot
table groups the data in rows by Date and separates it in columns by Is_Weekday
and uses SUM(Value) as the value. When I take the average of the Is_Weekday
column, instead of computing the average of all the Values, it considers the
Is_Weekday value as a value as well so the average gets thrown off by 1
element.

Ex. column has values 9, 2 for Is_Weekday = FALSE, SUM is 11 which is good but
AVERAGE is 3.67 which is wrong, it should be 5.5.

Steps to Reproduce:
1. Create a table with 3 columns: Date, Value, Is_Weekday. Assign arbitrary
values to Value
2. Create a pivot table which groups the data in rows by Date and separates it
in columns by Is_Weekday and uses SUM(Value) as the value
3. Compute the AVERAGE of the Is_Weekday = FALSE column (or the Is_Weekday =
TRUE column) and see that it is off by 1 element

Actual Results:  
AVERAGE includes boolean value as an element, so instead of taking the SUM of X
elements and dividing by X, it takes the SUM of X elements and divides by X + 1

Expected Results:
AVERAGE should include boolean value as an element, it should equal SUM of X
elements divided by X


Reproducible: Always

User Profile Reset: No

Additional Info:


User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20170911/897e15f3/attachment.html>


More information about the Libreoffice-bugs mailing list