Bug 77209 - Other: dbsum wrong when entering data using Alt+Enter
Summary: Other: dbsum wrong when entering data using Alt+Enter
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2.0.4 release
Hardware: Other All
: medium normal
Assignee: Kohei Yoshida
URL:
Whiteboard: BSA target:4.3.0 target:4.2.4
Keywords: regression
: 78473 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-04-09 00:48 UTC by Paulo da Silva
Modified: 2014-05-26 22:48 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
A small spread sheet. Relevant values are in red. The sum should be 300. Not 100. (11.53 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-04-09 00:48 UTC, Paulo da Silva
Details
First sample with some verifications. (12.74 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-04-10 23:09 UTC, m_a_riosv
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paulo da Silva 2014-04-09 00:48:09 UTC
Created attachment 97098 [details]
A small spread sheet. Relevant values are in red. The sum should be 300. Not 100.

Problem description: 
The attached spread sheet is self explanatory.

Steps to reproduce:
1. Create a 2 cols (V and C/N) table;
2. Enter a dbsum formula whose criterium is "Sum V when C/N col is C"
3. Sum is not performed for values in V when a group of C's are entered using Alt-Enter.

I also found another error regarding dbsum. There was a wrong sum in a big table. The sum got corrected after sorting the table! Unfortunately I couldn't understand what happened or reproduce it.

Operating System: Ubuntu
Version: 4.2.2.1 release
Comment 1 m_a_riosv 2014-04-09 20:26:04 UTC
Hi Paulo, thanks for reporting.
First you need a hard recalc after open the file [Ctrl+Shift+F9].

Alt-Enter, in this case doesn't enter a group of values.

Database functions use regular expressions, so if you want several values taking in account you need use the '|' (OR) in regular expressions to separate the values:

H4: =C|N

I think it is not a bug, please if you are not agree, reopen it.
Comment 2 Paulo da Silva 2014-04-10 17:56:03 UTC
Ctrl+Shift+F9 Could serve as a turn around for my work, but it only works after opening the spreadsheet. This is a bug and a serious one. Until recently it used to work fine, for several years.

Let's see if I can explain it better.

The small example is only part of a huge spreadsheet to illustrate the problem.

1. The spreadsheet has, among others, two columns: V (values) and C/N (a confirmation column).
2. I want a sum of the confirmed (those that have a C in the C/N column). I use dbsum for that.
3. Sometimes I need to confirm a range of values at once. This correspond to enter a C in each raw of each confirmed value in C/N column. One (unpractical) way is to enter each C the normal way (C followed by Enter). This works. Another way is to select the range of column C/N cells for the values I want confirmed, and enter a C followed by Alt+Enter. This correctly enter the Cs as pretended but the sum (dbsum) didn't get updated.
4. dbsum cell should be automatically updated.

To see the bug pls. do as follows in the original attached example:
1. Type Ctrl+Shift+F9 after opening the spreadsheet.
   The sum is 300 (100 for each C - confirmed value). This is correct.
2. Now, Select for example cells E3:E4. Enter C followed by Alt+Enter.
   The sum shows up 100 which is wrong!
BTW, Ctrl+Shift+F9 does not work anymore. It seems to work only immediately after opening the spreadsheet!
3. You may play with the example entering Cs or Ns the normal way or in ranges selecting the cells and entering C followed by Alt+Enter. The last way does not work, unless you save, reopen and type Ctrl+Shift+F9!

Thanks
Comment 3 m_a_riosv 2014-04-10 19:44:17 UTC
Hard recalc is not a work around, please see this comment of Eike, http://markmail.org/message/7epldrhq2gsaozle#query:+page:1+mid:7epldrhq2gsaozle+state:results

Enter as you say with Alt+Enter, works fine for me, and DSUM() is recalculate.

Please try resetting the user profile, sometimes solves strange issues.
https://wiki.documentfoundation.org/UserProfile
Comment 4 Paulo da Silva 2014-04-10 20:34:54 UTC
I have tested after deleting everything libreoffice related from my home dir. The bug still persists!

Please do the following:

1. Check your libreoffice version.
Mine is Versão: 4.2.2.1
ID da versão: 3be8cda0bddd8e430d8cda1ebfd581265cca5a0f

2. Open the original example I sent.
DSUM must show up 100 (this is wrong - the correct value should be 300)

3. Select cells E3 through E6
4. Enter uppercase C (without Enter)
5. Type Alt+Enter

After this DSUM should be 400.
I am getting 0 and this is wrong.

If you still don't see the problem let me know. I will install Libreoffice in another computer with windows (I am running kubuntu here) and will give it a try.

Thanks for your attention.
Comment 5 m_a_riosv 2014-04-10 23:08:35 UTC
Sorry Paulo, I can reproduce now, thanks for your persistence.

Reproducible:
Win7x64Ult.
Version: 4.2.0.4 Build ID: 05dceb5d363845f2cf968344d7adab8dcfb2ba71
Version: 4.2.2.1 Build ID: 3be8cda0bddd8e430d8cda1ebfd581265cca5a0f
Version: 4.3.0.0.alpha0+ Build ID: 34669e634d7cb18099e8d27eed10e5b816237411
   TinderBox: Win-x86@39, Branch:master, Time: 2014-04-09_03:01:14


Last working.
Version: 4.1.6.0.0+ Build ID: 0b772a163b2536fc55aa3b4de925119e33af769
Comment 6 m_a_riosv 2014-04-10 23:09:34 UTC
Created attachment 97200 [details]
First sample with some verifications.

Added the sample with some verifications.
Comment 7 Kohei Yoshida 2014-04-14 14:42:10 UTC
I'll take it.
Comment 8 Commit Notification 2014-04-14 15:41:37 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=85a070f93f4dc02a1c0142e4e8f03bde55227e76

fdo#77209: Adjust this test to cover clip document use case as well.



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.
Comment 9 Commit Notification 2014-04-14 15:41:50 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=8f403051968298fbabd61de82fbb6a77762c83cc

fdo#77209: Share string pool with clip documents.



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.
Comment 10 Kohei Yoshida 2014-04-14 15:46:09 UTC
4.2 backport: https://gerrit.libreoffice.org/9005
Comment 11 Commit Notification 2014-04-14 17:09:56 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=bb1bea8e01f899e43da4372fc4121e387d60102c&h=libreoffice-4-2

fdo#77209: Share string pool with clip documents.


It will be available in LibreOffice 4.2.4.

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.
Comment 12 Kohei Yoshida 2014-04-14 18:38:36 UTC
Now fixed.
Comment 13 Paulo da Silva 2014-04-22 00:54:30 UTC
It's OK for 4.2.4.
Thanks
Comment 14 GerardF 2014-05-09 09:59:56 UTC
*** Bug 78473 has been marked as a duplicate of this bug. ***
Comment 15 m_a_riosv 2014-05-26 22:48:56 UTC
Thanks Kohei.
Verified:
Win7x64
Version: 4.2.4.2 Build ID: 63150712c6d317d27ce2db16eb94c2f3d7b699f8
Version: 4.2.5.0.0+ Win-x86@42, Branch:libreoffice-4-2, Time: 2014-05-25_19:53:59
Version: 4.3.0.0.beta1 Build ID: 2e39c7e59c8fc8b16a54c3d981dceef27fb0c07f
Version: 4.4.0.0.alpha0+ Win-x86@39, Branch:master, Time: 2014-05-26_01:36:09