GNOME Bugzilla – Bug 599064
Incorrectly filters data that contains blank cells
Last modified: 2009-12-28 17:06:29 UTC
Created attachment 145873 [details] Spreadsheet example I have some large spreadsheets that have numerous blank cells. The advanced filter incorrectly selects all or most of the rows unless unless the blank cells are filled in. Steps to reproduce. In the example spreadsheet: 1. Select the "Data" block (A5:D8). 2. Data > Filter > Advanced Filter. The List range will show the selected block. 3. Select the Criteria range (G3:I5). 4. Select output range (L3:M10). 5. Press "OK". The output should show only "Mongoose", but incorrectly shows "Zebra". It's difficult to determine exactly what the nature of the error. If any blank cell were sufficient to trigger the error, then you would expect it to select "Aardvark" and "Cootie" as well. I tried rearranging the columns in the Data block and Criteria range, but it always selects any row with a blank in the "Attitude" column, regardless of position. By way of verification, Excel, Quattro Pro Windows, and OpenOffice all do this correctly.
First tested for version 1.8.4 for Ubuntu. I have also confirmed it for version 1.9.1 for Win XP.
This is clearly related to bug #311567 (the title of 311567 is misleading, that bug has really 2 parts left: strange handling of blank cells and required headers)
Maybe, but it doesn't stop at spaces and there is no crash.
When you read the bug report for bug #311567 you'll find out that the crash has been fixed and it doesn't stop at spaces anymore but: "2) It sometimes included empty spaces and sometimes didn't. I don't understand the logic, but I'm assuming there is one - if there is, could it be made clearer?"
Digging into the other bug report, it does appear that this one is probably similar. The logic is indeed messed up internally, but I don't see a simple rule that describes it completely. I can tell you, I just checked my spreadsheet, and it extracted 765 of 768 lines. It should have extracted roughly 1/5 of that number.
Would you please check the ranges that you mentioned in the original report. From teh sheet I suspect that you mean: A3:D8 for the list range G3:J5 for the criteria range.
Yes, that's correct. Sorry, I made TWO mistakes in the range.
Changing the status to clear the NEEDINFO flag. :-)
*** Bug 311567 has been marked as a duplicate of this bug. ***
We apparently have find_rows_that_match in value.c and find_cells_that_match in the database plugin. They really ought to be primarily the same (and the database version seems to be doing the right thing). Of course we really should have a database plugin use the version in value.c.
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.