Bug 33910 - Calc DSUM formula erroneously allows 0 in DatabaseField as proper syntax
Summary: Calc DSUM formula erroneously allows 0 in DatabaseField as proper syntax
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.3.0 release
Hardware: All Windows (All)
: medium normal
Assignee: Dietmar
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-04 08:50 UTC by Dietmar
Modified: 2015-10-02 17:25 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
test file with these sheets and formulas (33.50 KB, application/vnd.oasis.opendocument.spreadsheet)
2011-02-05 07:34 UTC, Dietmar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dietmar 2011-02-04 08:50:07 UTC
I have one document with minimum 2 sheets. on the first sheet I integrate the formula "=DBSUMME(Konto.$C2:$I591;0;Z$3:Z$45)", searching in the named sheet with arguments from the first sheet. Open it with LO 3.3 under Windows works well. Opening it under Linux results in "#WERT" content in the specific cell.
Changing the second argument from zero to one "=DBSUMME(Konto.$C2:$I591;1;Z$3:Z$45)" solves this behavior.

Is this correct?

Cheers Dietmar.
Comment 1 Rainer Bielefeld Retired 2011-02-05 00:01:25 UTC
@Dietmar
Please attach a sample document!
Comment 2 Dietmar 2011-02-05 07:34:26 UTC
Created attachment 42963 [details]
test file with these sheets and formulas

tested under LibreOffice running on Windows 7 x64 and Ubuntu 11.04 x64
Comment 3 Rainer Bielefeld Retired 2011-02-05 11:05:10 UTC
I only can confirm result 220 € in 'E8' with "LibreOffice 3.3.0 RC4 - WIN7  Home Premium (64bit) German UI  [OOO330m19 (build 6 / tag 3.3.0.4)]"
Comment 4 Dietmar 2011-02-09 09:56:06 UTC
Thats correct, the problem occurs on linux.

Dietmar.
Comment 5 karolus 2011-03-26 14:20:29 UTC
It works well with LibreOffice 3.3.2.2 OOO330m19 (Build:202) on  x64 Suse 11.4 ,
but not with (Suse -)LibreOffice 3.3.1.2 OOO330m19 (Build:8) on same OS
Comment 6 Chris Peñalver 2011-06-21 11:43:12 UTC
Dietmar, opening the attached file via the Terminal:

cd ~/Desktop && wget -c https://bugs.freedesktop.org/attachment.cgi?id=42963 -O example.ods && localc -nologo example.ods

and noting in cell E8 the malformed syntax:

=DSUM(Konto.$C2:$I591,0,I$3:I$57)+DSUM(Bank.$D1:$I607,5,I$3:I$57)-DSUM(Bank.$D1:$I607,6,I$3:I$57)

getting an error notice is expected as putting a 0 in the DatabaseField criteria is instructing DSUM to use column 0 in the function, which does not exist. This was further verified converting the attachment to xls and opening in Excel 2003 (11.5612.6505) via the Terminal:

unoconv --listener && unoconv -f xls example.ods && wine ~/.wine/drive_c/Program\ Files/Microsoft\ Office/OFFICE11/EXCEL.EXE example.xls

More information on DSUM may be found at:

http://help.libreoffice.org/Calc/Database_Functions#DSUM
http://office.microsoft.com/en-us/excel-help/dsum-HP005209069.aspx

If using 0 in Windows does not produce an error, then this is a bug in the Windows port of LO.

An expected error was produced using a 0 in Ubuntu 11.04, 32-bit.

lsb_release -rd
Description:	Ubuntu 11.04
Release:	11.04

apt-cache policy libreoffice-calc
libreoffice-calc:
  Installed: 1:3.3.2-1ubuntu5
  Candidate: 1:3.3.2-1ubuntu5
  Version table:
 *** 1:3.3.2-1ubuntu5 0
        500 http://us.archive.ubuntu.com/ubuntu/ natty-updates/main i386 Packages
        100 /var/lib/dpkg/status
     1:3.3.2-1ubuntu4 0
        500 http://us.archive.ubuntu.com/ubuntu/ natty/main i386 Packages
Comment 7 bfoman (inactive) 2013-08-14 21:19:09 UTC
Please check if this bug is still reproducible on Linux with the latest stable release (4.1.x).
Comment 8 bfoman (inactive) 2013-08-14 21:29:09 UTC
(In reply to comment #6)
> If using 0 in Windows does not produce an error, then this is a bug in the
> Windows port of LO.
> An expected error was produced using a 0 in Ubuntu 11.04, 32-bit.

Checked with:
Version: 4.2.0.0.alpha0+
Build ID: 087a610fcd5c0c354a9ed6bfccd3451b667d62a3
TinderBox: Win-x86@6-debug, Branch:master, Time: 2013-08-04_21:41:24
Windows 8.1 Enterprise Preview 64 bit

No errors for E8 cell - result is still 220 Euro for: 
=DSUM(Konto.$C2:$I591;0;I$3:I$57)+DSUM(Bank.$D1:$I607;5;I$3:I$57)-DSUM(Bank.$D1:$I607;6;I$3:I$57).
Comment 9 Alex Thurgood 2015-01-03 17:38:43 UTC
Adding self to CC if not already on
Comment 10 David Fischer 2015-10-02 17:24:55 UTC
All cells appear to be working as intended.  Perhaps this should be marked as "Resolved - WorksForMe"?

OS: Linux Mint 17.2
LO:
Comment 11 David Fischer 2015-10-02 17:25:39 UTC
(In reply to David Fischer from comment #10)
> All cells appear to be working as intended.  Perhaps this should be marked
> as "Resolved - WorksForMe"?
> 
> OS: Linux Mint 17.2
> LO: 5.0.2.2

LO: 5.0.2.2