Apache OpenOffice (AOO) Bugzilla – Issue 103166
Sorting by date does not work correctly
Last modified: 2015-09-13 21:30:45 UTC
When I try to sort any spreadsheet it sorts by some unknown irrelevant factor. Example 1: Here is a budget spreadsheet prior to sorting: http://picasaweb.google.com/yoneward/Computers#5352199557477103586 Here is the same spreadsheet after trying to sort by the date A to Z: http://picasaweb.google.com/yoneward/Computers#5352199558007346434 Example 2: Here is a spreadsheet I created to track game data prior to sorting: http://picasaweb.google.com/yoneward/Computers#5352199559487647026 Here is what it looks like after sorting A to Z: http://picasaweb.google.com/yoneward/Computers#5352199557989885026 This problem did not exist in prior versions of Calc.
Please provide a step by step scenario and a sample document which shows the problem.
Created attachment 63255 [details] Open document spreadsheet with sorting failure
I select a portion of a table Starting from the 'A' column over to the 'L' column and down a few rows to highlight the relevant data and click the sort button in the tool bar. None of the columns sort to any recognizable measure. With File: Hexazon, I select the entire table From "A" to "P" and click the sort button. There is no recognizable reason in the manner it sorts.
Created attachment 63256 [details] Budget Calc file does not sort by date correctly
OK, please try the following : select the column range from L to A so that the cell that is selected before you click the sort button is in column A. The behavior of sort function has been changed with version 3.1 : now when sorting a set of columns, it is done by the column containing the current cell, even it is not the first column. And now, by default, the first cell in the column is used as label.
Ah Ha! That works. I can see this possibly working better, because, as I recall, it used to be you could only sort by the left selected column before.
Ok, closing. Thanks.
Comment on attachment 63256 [details] Budget Calc file does not sort by date correctly Calc sorts according to the string representation of the date - but this does not help in case of a date format DD.MM.YYYY
(In reply to albrecht Faust from comment #8) > Comment on attachment 63256 [details] > Budget Calc file does not sort by date correctly > > Calc sorts according to the string representation of the date - but this > does not help in case of a date format DD.MM.YYYY Ooh, right. It should sort by the DateTime numerical value that is actually in the cell. That will always get it right unless the user does something very strange. This would depend on the cell actually being Numeric but formatted to present as a date or time-span. If any of the cells involved have text value, there's not much to be done, although sorting might help the user recognize what can be an easy mistake. I am reopening until we verify this aspect.
I can't see any problem. The sort button sorts by the column where the cell cursor is in place. If the cell cursor is located in column A (select from L to A) it sorts the dates right. What is your result?
Created attachment 84914 [details] Three date formats that sort in the same sequence (In reply to albrecht Faust from comment #8) > Comment on attachment 63256 [details] > Budget Calc file does not sort by date correctly > > Calc sorts according to the string representation of the date - but this > does not help in case of a date format DD.MM.YYYY I just checked this in Apache OpenOffice 4.1.1. In all cases, whatever the formatting used for the date, the columns are sorted by the chronological progression of the dates. Here are the ones I tried. I will check your exact use of DD.MM.YYYY to see if that makes any difference.
(In reply to orcmid from comment #11) > Created attachment 84914 [details] > Three date formats that sort in the same sequence > > I will check your exact use of DD.MM.YYYY to see if that makes any > difference. In the third column, I used the explicit format DD.MM.YYYY and it all worked, even after resorting the 5 rows. Please check for how your DD.MM.YYYY cells are formatted as dates. I notice, on an en_US installation, if I enter 25.01.1939 without specifying that the cell is for a date format, the entry is treated as a text string (and left-justified in the cell). If I specify that format for the cells first, entries work just fine. So the problem some may experience is that DD.MM.YYYY in their locale is not automatically recognized as a date unless the cell format is specified first?