After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 149945 - dsum function misbehaving
dsum function misbehaving
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: Main System
1.2.x
Other Linux
: Normal normal
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2004-08-11 22:36 UTC by chris dunn
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
testcase (1.52 KB, application/octet-stream)
2004-08-19 05:17 UTC, Andreas J. Guelzow
  Details
patch (1.62 KB, patch)
2004-08-21 20:20 UTC, Andreas J. Guelzow
none Details | Review

Description chris dunn 2004-08-11 22:36:47 UTC
function dsum(database,field,criteria)

When my database has more than 10 fields and "field" is used to reference e.g.
field 14. then the dsum is not correctly calculated. To get the total
of field 14 (first field in database taken as 0) it is necessary to
enter the field as 3 instead of 14.

If the field label is used instead of the field number then the
calculation is correct.
Comment 1 Morten Welinder 2004-08-12 20:44:53 UTC
Please give us a concreate example of the type

A1=42
A2=14
...
A22=dsum(...)

or a test sheet that shows a specific formula that misbehaves.  Also please
let us know what cell contains a wrong answer *and* what the right one is.
Comment 2 Andreas J. Guelzow 2004-08-19 05:17:07 UTC
I can't quite get that example to work but a similar situation is exposed in the
following gnumeric file. I believe the correct value in A5 should be 1, not 13.
Comment 3 Andreas J. Guelzow 2004-08-19 05:17:50 UTC
Created attachment 30735 [details]
testcase
Comment 4 Andreas J. Guelzow 2004-08-19 14:20:22 UTC
This bug is not specific to dsum. Dcount is similarly misbehaving:

in the test sheet edit A5 to use dcount rather than dsum. Delete the content of M2.

A5 now shows 0 but should show 1.
Comment 5 Andreas J. Guelzow 2004-08-19 14:21:18 UTC
oh, my test cases show the bug in current cvs. I haven't tried 1.2.x.
Comment 6 Andreas J. Guelzow 2004-08-21 20:18:57 UTC
fixed in cvs HEAD (I guess specifying column numbers was never tested.)
I am attaching a patch and leave this report open to facilitate backporting to
1.2.x if desired.
Comment 7 Andreas J. Guelzow 2004-08-21 20:20:22 UTC
Created attachment 30815 [details] [review]
patch

already committed to HEAD
Comment 8 Jody Goldberg 2004-08-21 22:23:56 UTC
Feel free to apply to 1.2, at this point I'm not planning to release 1.2.14, but it can't hurt.
Comment 9 Andreas J. Guelzow 2004-08-22 02:04:42 UTC
backported to 1.2.x