Bug 142664 - EDITING Calc Auto-Filter does not filter empty cells with a formula when "not empty" is selected
Summary: EDITING Calc Auto-Filter does not filter empty cells with a formula when "not...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.1.3.2 release
Hardware: All Windows (All)
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-05 01:25 UTC by Daniel
Modified: 2022-04-29 09:10 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
shows the auto-filter "not empty" behavior as well as Std filter with screenshot (22.82 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-06-05 16:38 UTC, Daniel
Details
Standard Filter set to equal blank value (36.50 KB, image/jpeg)
2022-04-27 16:35 UTC, Daniel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel 2021-06-05 01:25:43 UTC
Description:

If I enter nothing into a cell, the "not empty" filter hides the row correctly.
If the cell has a formula that assigns "" to the cell, the row remains visible.
Test spreadsheet has entries as:
TestColumnHeading
4
=IF(2=2,"", "never happen")
2

8


Steps to Reproduce:
1. Enter the data from the description in 6 cells of a column
2. Select the cells and auto-filter
3. Select "not empty from the filter drop down

Actual Results:
TestColumnHeading
4

2
8

Expected Results:
TestColumnHeading
4
2
8




Reproducible: Always


User Profile Reset: Yes



Additional Info:
Work around:
Use a standard filter
Cell <>  ...and leave the value field blank
Select OK
Calc with automatically insert a  "0" into the value field
Re-open the Standard Filter dialog
Remove the "0"
Select OK again

Version: 7.1.3.2 (x64) / LibreOffice Community
Build ID: 47f78053abe362b9384784d31a6e56f8511eb1c1
CPU threads: 8; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL
Comment 1 m_a_riosv 2021-06-05 11:59:45 UTC
Please attach a sample file with the issue.
Comment 2 Daniel 2021-06-05 16:38:02 UTC
Created attachment 172645 [details]
shows the auto-filter "not empty" behavior as well as Std filter with screenshot
Comment 3 Buovjaga 2022-04-27 12:33:17 UTC Comment hidden (obsolete)
Comment 4 Regina Henschel 2022-04-27 13:28:11 UTC
Your expectation is wrong. Cell A3 contains a formula, so it is not empty. The items 'Empty' and 'Not Empty' use the same logic as the function ISBLANK.



To have more than one auto-filter on a sheet, you need to define a range of the data (menu Data). The range needs to contain a label cell. Then select the range (menu Data) and then apply auto-filter. If you do not define a range, an auto-filter works on an anonymous range and there is only one anonymous range per sheet.
Comment 5 Daniel 2022-04-27 16:35:12 UTC
Created attachment 179811 [details]
Standard Filter set to equal blank value

From the auto filter drop-down, I selected "Standard Filter" and set the third cell to equal nothing (the value field was left blank.  The first time I do this the UI sets the blank value to "0", so I go back and remove the "0".
The attachment shows that there are 3 possible values and the only one that is selected is "(empty)", so something is wrong in that the filter reports an (empty) value but it does not match the Auto Filter "Empty" filter.

Although I don't think a filter should be impacted by the presence of a formula, I don't want to break old sheets, so maybe the solution is not to change the "Empty" filter but possibilities I see:
1) Change the wording in the values area of the filter drop-down from "(empty)" to "blank value"
2) Add an auto filter of "Blank Value" or "Empty Value" to emphasize the difference from a completely empty cell

At that point, I'm not sure if this changes from a bug to an enhancement.
Thanks for looking into this.
Comment 6 Heiko Tietze 2022-04-29 09:09:58 UTC
To summarize, your problem is that ="" is not Empty. 

Example

         = ""  empty
A1         x       x 
A2 =""     x 
A3 =1

Same behavior in v5.2 and 7.3. MSO365 has no "empty" filter and does the same for ="" and filtering for "(Blanks)". 

I wouldn't change empty into blank since the formula could also have a meaning like =IF(A1=1;"1";""). Our approach is more flexible and more clear. Concur with NAB.