[Solved] Calc Sort not sorting columns together

Discuss the spreadsheet application
Post Reply
Paul_F
Posts: 2
Joined: Thu Jan 10, 2019 12:08 am

[Solved] Calc Sort not sorting columns together

Post by Paul_F »

I have two columns in a sheet that I need to sort. First column is text, second is date/time. I need to sort by date/time. I select the two columns as a range, set the sort to Ascending by the date column (headers included and set as such in sort). Sort correctly sorts the date column, but does nothing at all to the other column. Thus the two bits of data become unconnected. I've tried creating some simple test data of a similar nature, and sort works fine. I've tried removing all the slashes, dashes and spaces to see if they are a problem. I've tried copying the sort to a new range. Tried making the date the first column. Can't think what to try next. Feels like I'm missing something obvious.
Attachments
Sort_example.ods
(20.67 KiB) Downloaded 101 times
Last edited by Paul_F on Thu Jan 10, 2019 3:11 am, edited 1 time in total.
Apache Open Office 4.1.6 AOO416m1(Build:9790) - Rev. 1844436 2018-10-23 12:57; running on Windows 10 Pro V 1607 Bld 14393.1480
User avatar
Lupp
Volunteer
Posts: 3553
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Calc Sort not sorting columns together

Post by Lupp »

I cannot verify the claims.
The data were sorted by the TIME coilumn in the given example. I thus needed to first create disorder to be able to test sorting then.
The sorting for both columns wiht TIME as the key (ascending was done correctly in AOO 4.1.5 and in LibO 6.1.4.2 as well. (I haven't yet installed AOO 4.1.6.)

A few more explanations you find in the attached file.

If the supplied file was not the one that showed the issue for you, my tests are worthless most likely.
Attachments
Sort_example_1.ods
(34.15 KiB) Downloaded 82 times
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
User avatar
MrProgrammer
Moderator
Posts: 4907
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Calc Sort not sorting columns together

Post by MrProgrammer »

Paul_F wrote:Sort correctly sorts the date column, but does nothing at all to the other column.
No, the ASC column was also sorted. However you have many duplicate keys and it just so happens that the sorted order for ASC matches the unsorted order.

Your example is similar to this:
Text       Key
Now        P
Now        A
Is         C
The        K
Now        M
The        Y
Now        B
Time       O
Now        X
Now        W
Now        I
Now        T
The        H
When sorted by Key, A moves to the top but it's Text (Now) happens to match the first line of the unsorted data. B comes next but it's key (Now) also matches the second line of the unsorted data. C remains where it is. H is next and its key (The) matches line 4. And so on.

Thanks for the interesting question.

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Calc Sort not sorting columns together

Post by RusselB »

Testing the original attachment, but making the slight modification in the Sort dialog to copy the sorted data to a different location, I noticed that a lot of the data in ASC from Sheet1 matched the data in Sheet2 (where the sorted data was copied to) matched on a row by row basis.
The original attachment had most, but not all, of the data in the TIME column in ascending order (only 6 entries were not in order).
Sorting the data per the instructions in the original post, but sending the sorted data to Sheet2, a comparison of the sorted data for column ASC and the unsorted data for the same column, showed a high level of matches, though not complete. Out of the 480 data points that were sorted, only 2 of them ended up in different locations after sorting.
This, I'm thinking, has to be a fluke somewhere along the lines of someone picking all of the correct lottery numbers the first time they play (well, maybe not that bad), but a fluke for sure.
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
Paul_F
Posts: 2
Joined: Thu Jan 10, 2019 12:08 am

Re: Calc Sort not sorting columns together

Post by Paul_F »

Thanks to you all. While you were posting, using the same methodology as the first responder, I figured this out as well. This should have been obvious to me given that I created the data in the first place, but I didn't see it until I added numbers to the text. For those interested, the text list is actually a set of Astrological Midpoints, organized by Sign, and thus repeated 12 times. The text would normally be displayed in an astrological font. The times are the occurrences of those midpoints over the course of a day. So as you see ,I knew they were repeating but didn't make the connection. Thanks to you all for your understanding, help, and quite impressive insight into what was happening.
Apache Open Office 4.1.6 AOO416m1(Build:9790) - Rev. 1844436 2018-10-23 12:57; running on Windows 10 Pro V 1607 Bld 14393.1480
Post Reply