Bug 45125 - FILTER: AUTOFILTER disappears after sorting
Summary: FILTER: AUTOFILTER disappears after sorting
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected)
3.5.0 RC1
Hardware: Other All
: medium normal
Assignee: Not Assigned
Whiteboard: BSA
: 64051 66527 (view as bug list)
Depends on:
Reported: 2012-01-23 05:29 UTC by th
Modified: 2014-10-12 19:21 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:
Regression By:


Note You need to log in before you can comment on or make changes to this bug.
Description th 2012-01-23 05:29:36 UTC
Problem description: 

Steps to reproduce:
1. ....set AUTOFILTER
2. ....SORT spreadsheet
3. ....AUTOFILTER disappears

Current behavior: AUTOFILTER disappears after sorting spreadsheet

Expected behavior: should not disappear

Platform (if different from the browser): 
Browser: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.18 (KHTML, like Gecko) Chrome/18.0.1010.0 Safari/535.18
Comment 1 Markus Mohrhard 2012-01-24 04:26:37 UTC
This happens because you use a annonymous database range for both sorting and defining your autofilter.

You can solve this problem by creating a named database range at Data->Define Range and then while this range is still selected create an autofilter. Then you have an autofilter using a named database range which will not disappear if you sort your sheet.
Comment 2 Tristan Miller 2012-07-27 12:34:46 UTC
I'm not sure why it should matter why the range is anonymous, so why force the user to define one?

If defining a range really is necessary, then it would help if, when the user tries to sort an anonymous range while autofilter is enabled, a warning dialog appeared explaining that sorting can be carried out only if the autofilter is removed, and asking for confirmation.  For LibreOffice to simply silently remove the autofilter appears to the average user to be a bug, or at least an unintended effect.
Comment 3 Markus Mohrhard 2012-07-27 12:44:39 UTC
I don't agree. Anonymous database ranges are the way to quickly sort, filter, ... a range. If you need a permanent solution never use the anonymous versions, you can't even check which range they use.
Comment 4 Tristan Miller 2012-07-27 14:29:02 UTC
I'm not disputing that your advice on defining ranges is sound, but it certainly isn't intuitive to most users.  Everyone whom I have shown this behaviour to is mystified as to why the autofilter disappears when the sort dialog appears.  A dialog or some other UI message explaining *why* the autofilter must be removed seems sensible, and will prevent a lot of misunderstanding and frustration.

Perhaps a dialog box worded as follows would be appropriate to display when the user tries to sort an anonymous range when autofilter is enabled:

Warning - Sorting is not possible when AutoFilter is enabled on an anonymous range.  AutoFilter will be removed.

[ OK ] [ Cancel ]

This at least tells the user *why* the autofilter is about to disappear, and gives him some clue as to how to apply an autofilter that doesn't conflict with sorting.
Comment 5 Tristan Miller 2012-08-01 13:49:27 UTC
I just tried the same steps with two other popular spreadsheets: Gnumeric (version 1.11.3), and Microsoft Excel 2010.  Neither of them remove the autofilter when sorting.

It seems therefore that it is possible to sort anonymous ranges, or else those programs are making some sensible guesses as to what the range is.  Is there some reason why LibreOffice's behaviour could not be brought into line with these other products?

In light of this evidence (and the informal user study mentioned in my previous comment) I hope it's not too presumptuous to have reopened this bug.
Comment 6 Markus Mohrhard 2012-08-01 15:51:37 UTC
Please don't reopen this bug report. Neither Excel nor Gnumeric use anonymous database ranges.
Comment 7 Tristan Miller 2012-08-01 16:35:23 UTC
OK.  I'd like to better understand the difference in these applications' behaviour so that the problem (and solution) for this use case can be properly formulated.  Could you tell me how Gnumeric and Excel determine the database range upon which to filter and/or sort, and how this differs from what LibreOffice Spreadsheet does?
Comment 8 Jean-Baptiste Faure 2014-10-12 17:39:47 UTC
*** Bug 66527 has been marked as a duplicate of this bug. ***
Comment 9 Jean-Baptiste Faure 2014-10-12 19:21:19 UTC
*** Bug 64051 has been marked as a duplicate of this bug. ***