Created attachment 88047 [details] An ODT document, illustrating with a screenshot, the situation described above. Problem description: The DCOUNT and DCOUNTA functions have a parameter 'Database field', stated as 'required' which appears to be optional. Steps to reproduce: 1. Open an instance of Calc and launch the Function Wizard. 2. Select the Database category and double-click on DCOUNT or DCOUNTA. 3. Click in the Database field input box to display the explanation. Current behavior: It states that this parameter is required. It can be omitted in both functions without returning an error and with the correct result being returned. Expected behavior: Either the instructions for both functions are wrong and the parameter is optional, or the functions have a bug which fails to return an error. The Help file text for DCOUNT specifically states the parameter cannot be omitted. The Help text for DCOUNTA is not specific about it, but that conclusion can be drawn from the phrasing. It appears that as long as the Search criteria parameter includes the field heading a result will be returned. Operating System: Windows XP Version: 4.1.2.3 release
Created attachment 88048 [details] Spreadsheet illustrating the problem described.
Let's examine the behaviour of the function DCOUNT or DCOUNTA : 1/ first, it applies a selection on the DB lines (the DB is the fisrt argument, the criteria is the third argument), 2/ secondly, it counts the number of selected lines which have one column (pointed to by the second argument, by name or by rank from 1 to N) or the totality of the columns (second argument = 0 or omited) containing a value either numeric (DCOUNT) or non empty (DCOUNTA). I added "or omited" because it is what we see and it is logical. So NotABug, but a clarification to do in the documentation.
Hi Dominique. I'm working with the LO Docs team doing the User Guides, but not the Help documentation. I'm trying to determine whether the documentation is wrong in its description or the function is buggy. I'm quite happy to write up the User Guide to indicate this is an optional parameter if that's the case. Thanks, JS
@Dominique Boutry and John Smith: if it is NOTABUG and only documentation correction is needed can we close this bug and report new one for docs/help fix?
(In reply to comment #4) > @Dominique Boutry and John Smith: if it is NOTABUG and only documentation > correction is needed can we close this bug and report new one for docs/help > fix? I am of the opinion that this is a bug having read through the specification here; http://docs.oasis-open.org/office/v1.2/cs01/OpenDocument-v1.2-cs01-part2.html#DCOUNT which shows no parameter to be optional.
Winfried: Your insight regarding these functions would be appreciated. Thanks!
(In reply to Robinson Tryon (qubit) from comment #6) > Winfried: Your insight regarding these functions would be appreciated. > Thanks! I will have a look at the ODF1.2 standard and the code, but probably not this week.
(In reply to Robinson Tryon (qubit) from comment #6) My conclusion after a quick look in the code base is that the code explicitly allows the absence of the field argument, as long as the criteria argument produces valid results (DCOUNT as well as DCOUNTA). The ODF1.2 standard does not mark any argument optional. One could wonder if this is a violation of the standard or functionality that is more than required by the standard. We have more functions in Calc that offer more functionality than is required by the standard. The code has not been changed since the start of LibreOffice, the last change to the DCOUNT/DCOUNTA code is from March 2010. I would suggest to change the (help) documentation to reflect its actual functionality, which IMHO is more user friendly than strict coherence to the standard. But then, I'm only a developer ;-)
(In reply to Winfried Donkers from comment #8) > (In reply to Robinson Tryon (qubit) from comment #6) > > My conclusion after a quick look in the code base is that the code > explicitly allows the absence of the field argument, as long as the criteria > argument produces valid results (DCOUNT as well as DCOUNTA). > > The ODF1.2 standard does not mark any argument optional. > > One could wonder if this is a violation of the standard or functionality > that is more than required by the standard. We have more functions in Calc > that offer more functionality than is required by the standard. So strictly speaking, it sounds like the code disagrees with the standard. > The code has not been changed since the start of LibreOffice, the last > change to the DCOUNT/DCOUNTA code is from March 2010. > > I would suggest to change the (help) documentation to reflect its actual > functionality, which IMHO is more user friendly than strict coherence to the > standard. But then, I'm only a developer ;-) Fair enough. That solution seems reasonable to me, especially if we were to make a note of our deviation from the standard the way that we do with extensions to ODF: https://wiki.documentfoundation.org/Development/ODF_Implementer_Notes/List_of_LibreOffice_ODF_Extensions In any case, it seems clear that there's some real work to be done here (Documentation, development, or etc..), so Status -> NEW.
Adding self to CC if not already on
** Please read this message in its entirety before responding ** To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present on a currently supported version of LibreOffice (5.0.4 or later) https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the version of LibreOffice and your operating system, and any changes you see in the bug behavior If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a short comment that includes your version of LibreOffice and Operating System Please DO NOT: - Update the version field - Reply via email (please reply directly on the bug tracker) - Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) http://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to "inherited from OOo"; 4b. If the bug was not present in 3.3 - add "regression" to keyword Feel free to come ask questions or to say hello in our QA chat: http://webchat.freenode.net/?channels=libreoffice-qa Thank you for your help! -- The LibreOffice QA Team This NEW Message was generated on: 2016-01-17
ODFF doesn't specify the Field parameter optional, but Excel accepts an empty missing argument, which is why Calc also does. Furthermore, at least in the DCOUNT case Excel behaves different if the argument is specified or missing. If missing, DCOUNT behaves like DCOUNTA on the matching set no matter whether there is numeric content or not, i.e. all rows that are matched by the criteria are counted. These things need clarification in the help documentation and the Field argument value of 0 shouldn't be mentioned at all, it caters for old versions and is incompatible with other implementations. Additionally the ODFF specification needs to be adapted for the empty missing argument case.
Eike Rathke committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/help/commit/?id=f5f2b4982350ee6e0616d49742b29b0a57edbbbb tdf#70806 get rid of the "number 0 for the entire database" nonsense
Eike Rathke committed a patch related to this issue. It has been pushed to "libreoffice-5-2": http://cgit.freedesktop.org/libreoffice/help/commit/?id=c1724f5eeef808cefac89d5101c25f06aab1a55a&h=libreoffice-5-2 tdf#70806 get rid of the "number 0 for the entire database" nonsense
Submitted to the ODF-TC comment list: 6.9.3 DCOUNT Syntax: DCOUNT( Database D ; Field F ; Criteria C ) 6.9.4 DCOUNTA Syntax: DCOUNTA( Database D ; Field F ; Criteria C ) For these two functions the Field argument can be omitted (empty) in LibreOffice Calc and Microsoft Excel, it should be defined as Syntax: DCOUNT( Database D ; [ Field F ] ; Criteria C ) Semantics: If the Field argument is omitted, DCOUNT returns the count of all records that satisfy Criteria. Syntax: DCOUNTA( Database D ; [ Field F ] ; Criteria C ) Semantics: If the Field argument is omitted, DCOUNTA returns the count of all records that satisfy Criteria.
Eike Rathke committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/help/commit/?id=5b1cb4f0bfbae734818ae791165cd1ea7ac5fdcb tdf#70806 DCOUNT and DCOUNTA DatabaseField argument can be omitted
Eike Rathke committed a patch related to this issue. It has been pushed to "libreoffice-5-2": http://cgit.freedesktop.org/libreoffice/help/commit/?id=a3f89c38a446d74b5327544de7b753964ce94a29&h=libreoffice-5-2 tdf#70806 DCOUNT and DCOUNTA DatabaseField argument can be omitted
Eike Rathke committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=a88ee01b8683ded7d9da6dbcbf4d3e0c2ed4cadc omit DCOUNT or DCOUNTA 2nd argument if 0 when writing ODFF or OOXML, tdf#70806 It will be available in 5.3.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Eike Rathke committed a patch related to this issue. It has been pushed to "libreoffice-5-2": http://cgit.freedesktop.org/libreoffice/core/commit/?id=acb0f28e97874b22bd899e5cf04f2a8363a42e7a&h=libreoffice-5-2 omit DCOUNT or DCOUNTA 2nd argument if 0 when writing ODFF or OOXML, tdf#70806 It will be available in 5.2.0.1. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Eike Rathke committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=3129b75fca1ec38fc79cbc5397b28923fc273ff9 strip 0 argument only if not part of an expression, tdf#70806 It will be available in 5.3.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Eike Rathke committed a patch related to this issue. It has been pushed to "libreoffice-5-2": http://cgit.freedesktop.org/libreoffice/core/commit/?id=88630f20d1f26d74980e81721cd621b6f309a9ec&h=libreoffice-5-2 strip 0 argument only if not part of an expression, tdf#70806 It will be available in 5.2.0.1. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Eike Rathke committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=2b6710c2b50c83f62824fd2b258b112a5e911da1 check for svDouble when stripping DCOUNT/A argument, tdf#70806 follow-up It will be available in 5.3.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Eike Rathke committed a patch related to this issue. It has been pushed to "libreoffice-5-2": http://cgit.freedesktop.org/libreoffice/core/commit/?id=bfef572871441a8cdc9509e26afbef208e4f6243&h=libreoffice-5-2 check for svDouble when stripping DCOUNT/A argument, tdf#70806 follow-up It will be available in 5.2.0.1. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.