Bug 163636 - Autofilter uses all rows instead of a subset.
Summary: Autofilter uses all rows instead of a subset.
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
24.8.1.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: AutoFilter
  Show dependency treegraph
 
Reported: 2024-10-26 14:16 UTC by Andrew
Modified: 2024-12-31 12:21 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Example data incorrect result and expected results as different sheets (25.18 KB, application/ods)
2024-10-26 14:25 UTC, Andrew
Details
This sheet is working correctly (18.59 KB, application/vnd.oasis.opendocument.spreadsheet)
2024-10-31 19:13 UTC, Andrew
Details
sort not working correctly per last comment. (43.88 KB, application/vnd.oasis.opendocument.spreadsheet)
2024-11-07 15:02 UTC, Andrew
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew 2024-10-26 14:16:00 UTC
Description:
Select a range for auto filter (Say A through M and 1 through 30).  Applying a sort, eg descending, sorts all rows not just 1 through 30.  This use to work and does not after I upgraded to 24.8.2.1  build https://git.libreoffice.org/core/+log/0f794b6e29741098670a3b95d60478a65d05ef13


Steps to Reproduce:
1.Select table of Data with Headings less than all the rows and apply auto filter
2.Place some information below the  tables.  This can be either stuff in cells (text) or table summary information (column sum, max, median, etc)
3.Sort on any of the columns using the icon in the header row.


Actual Results:
Rows with table summary info or other data below the selected range get sorted along with the selected data. 

Expected Results:
Only the rows selected when applying auto filter are sorted.  The rows below the table are left in place. 


Reproducible: Always


User Profile Reset: Yes

Additional Info:
[Information automatically included from LibreOffice]
Locale: en-US
Module: SpreadsheetDocument
[Information guessed from browser]
OS: Windows (All)
OS is 64bit: no
Comment 1 Andrew 2024-10-26 14:25:22 UTC
Created attachment 197250 [details]
Example data incorrect result and expected results as different sheets

The attached file is a Calc Sheet stored as an ODS
Comment 2 raal 2024-10-31 15:17:17 UTC
(In reply to Andrew from comment #0)
> Description:
> Select a range for auto filter (Say A through M and 1 through 30).  Applying
> a sort, eg descending, sorts all rows not just 1 through 30.  This use to
> work and does not after I upgraded to 24.8.2.1  build
> https://git.libreoffice.org/core/+log/
> 0f794b6e29741098670a3b95d60478a65d05ef13
> 
Do you know in which version this worked? I tested few versions (4.1, 7.3.7, 25.2) and in these versions is autofilter expanded to whole data set.
Comment 3 Andrew 2024-10-31 19:06:46 UTC
I have other computers that this works correctly on as I have not upgraded on those.  Just verified things worked correctly on version 7.4.5.1 .  Here is the copied version info from  Help Version Info.  

Version: 7.4.5.1 (x64) / LibreOffice Community
Build ID: 9c0871452b3918c1019dde9bfac75448afc4b57f
CPU threads: 12; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL
Comment 4 Andrew 2024-10-31 19:13:37 UTC
Created attachment 197325 [details]
This sheet is working correctly

The attached sheet created in V 7.4.5.1 works correctly in the version I have been having problems with  

Version: 24.8.2.1 (X86_64) / LibreOffice Community
Build ID: 0f794b6e29741098670a3b95d60478a65d05ef13
CPU threads: 24; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded
Comment 5 raal 2024-11-01 05:51:17 UTC
(In reply to Andrew from comment #4)
> Created attachment 197325 [details]
> This sheet is working correctly
> 
But this example is different. After the data table are empty rows. In previous file the data table and lines "Bellow table" was without empty rows.
Comment 6 Andrew 2024-11-07 15:01:07 UTC
I have gone back to the file that started giving me problems after the upgrade.  I have extracted one sheet from the many that where there.  This spread sheet originally had 55 sheets and has worked for several years.  After the upgrade it stopped.  

In the sheet attached I Performed several steps
1.     Selected the whole sheet and pressed the auto filter button twice to remove 
      auto filters. 
2.     inserted several new (empty) rows after row 34 (rows 35 through 39).  
3.     Then selected rows 1 through 34 and applied auto filter.
4.     Attempted to sort column I ascending.  Received message stating range had 
      merged cells.
5.     Selected rows 1 through 39 and selected unmerge cells button.
6.     Attempted to sort column I ascending.  Received message stating range had 
      merged cells (again).
7.     Selected rows 40 through 60 selected unmerge cells button.
8.     Attempted to sort column I ascending.  Sort was performed, but incorrectly
     Rows 42 and 44 where included in the selection becoming rows 32 and 33.  Rows 
     40, 41, 43, and 45 where not sorted and became rows 42 43, and 45.  
I have left the spreadsheet in the condition prior to step 8.  If you attempt to sort row "I" ascending, you should be able to repeat the results in step 8.  

I attempted to  correct the problem in my sheets by deleting the problematic rows and making new rows 42 and 43 after the sorting.  Didn't work it grabbed the two rows again.
Comment 7 Andrew 2024-11-07 15:02:23 UTC
Created attachment 197479 [details]
sort not working correctly per last comment.

See previous comment by Andrew kettner
Comment 8 Jack 2024-12-31 08:39:15 UTC Comment hidden (spam)
Comment 9 Charles Williams 2024-12-31 12:21:35 UTC
Behaviour occurs with 'sort not working per last comment' example spreadsheet on macOS

Version: 24.8.4.2 (AARCH64) / LibreOffice Community
Build ID: bb3cfa12c7b1bf994ecc5649a80400d06cd71002
CPU threads: 8; OS: macOS 15.2; UI render: default; VCL: osx
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: threaded

Based on some quick experiments, it seem to me that the range definition used by the AutoFilter is not destroyed when AutoFilter is deselected. So, if you deselect AutoFilter, insert some blank rows and then reselect AutoFilter the new rows are included in the range when AutoFilter is reselected.

I hope this helps.