Page 1 of 1

OOo 3.1 - Sort in reverse order

Posted: Thu May 21, 2009 6:57 am
by andyqkw
Just installed OOo 3.1 and the sort function in Calc are not functioning correctly.

Clicking on the sort icon A -> Z returns the result as Z -> A instead.

Same goes to Z -> A, returning the result as A -> Z.

Re: OOo 3.1 - Sort in reverse order

Posted: Thu May 21, 2009 11:48 am
by Nikos
Sounds strange...

but cannot replicate it.

Re: OOo 3.1 - Sort in reverse order

Posted: Thu May 21, 2009 2:05 pm
by FJCC
I also can't replicate the effect. Could you post some details about what you are trying to sort and what happens?

Re: OOo 3.1 - Sort in reverse order

Posted: Thu May 21, 2009 3:26 pm
by TheGurkha
Strange, indeed. Look at my two screen shots. They both have the same dummy data. One of them is sorted A->Z and the other Z->A. In the Z->A order it doesn't seem to be sorting the very first cell.
Sorted A -> Z
Sorted A -> Z
Sorted Z -> A
Sorted Z -> A

Re: OOo 3.1 - Sort in reverse order

Posted: Thu May 21, 2009 3:34 pm
by acknak
I suspect that Calc finds a text value in the first cell and assumes it's a column heading, so it stays at the top.

Re: OOo 3.1 - Sort in reverse order

Posted: Thu May 21, 2009 3:36 pm
by Villeroy
The first row is treated as column label. It's a shame that the developers are unable to write a working label detector.

Re: OOo 3.1 - Sort in reverse order

Posted: Sat May 23, 2009 6:28 am
by andyqkw
Did some further testing myself...

This document of mine was initially created with OOo 2.X and is saved in .xls format.

On one spreadsheet (created this year), Calc sorts the data in reverse order for row 2 - 46 (row one being the header) and anything from row 47 onwards sorts in the correct order.

On another spreadsheet (created few years back), Calc sorts in complete random order regardless of rows number.

Tried creating a new spreadsheed with OOo 3.1 but couldn't reproduce the error???

Re: OOo 3.1 - Sort in reverse order

Posted: Thu Jun 04, 2009 6:04 pm
by andyqkw
I've uploaded a sample file for all experts out there to see, it's sorting the column in random order...

Re: OOo 3.1 - Sort in reverse order

Posted: Thu Jun 04, 2009 6:09 pm
by Dave
In the sort window, look for the "Options" tab, and "Range contains column labels". Deselect that to include the top item.

David.

Re: OOo 3.1 - Sort in random order

Posted: Sun Jun 28, 2009 8:57 am
by andyqkw
Tried that, doesn't work.

Re: OOo 3.1 - Sort in reverse order

Posted: Sun Jun 28, 2009 12:42 pm
by Villeroy
Running Sun's version of OOo3.1, I changed the description values in the above "Sample.xls" to ...

Code: Select all

one
two
three
four
five
six
... so I have better control which text is sorted with which number.

I click any cell in the list's first column and quick-sort [A-Z]:

Code: Select all

Description	Amount
five	$5.00
four	$4.00
one	$1.00
six	$6.00
three	$3.00
two	$2.00
It correctly sorts the first column alphabetically, detecting the first header row.
Hitting the [Z-A] button, I get the exact reverse order.

Code: Select all

Description	Amount
two	$2.00
three	$3.00
six	$6.00
one	$1.00
four	$4.00
five	$5.00
Focussing a cell in the second column I get from [A-Z]

Code: Select all

Description	Amount
one	$1.00
two	$2.00
three	$3.00
four	$4.00
five	$5.00
six	$6.00
and [Z-A]

Code: Select all

Description	Amount
six	$6.00
five	$5.00
four	$4.00
three	$3.00
two	$2.00
one	$1.00
In either case the sorted range gets selected if I focussed just a single cell.
menu:Data>Sort... gives the same 4 results, sorting each of the two columns in ascending and descending order.

I append values "seven" and 7 in row #8, click [A-Z], [A-Z] and to my surprise the new row gets included although I did not insert a new row of cells into the existing data range. Everything sorts perfectly.
Alphabetical by column A ("Description"):

Code: Select all

Description	Amount
five	$5.00
four	$4.00
one	$1.00
seven	$7.00
six	$6.00
three	$3.00
two	$2.00
the reverse order is exactly revers, numeric sorting of column B ("Amount") works as well.

Now I define a database range in menu:Data>Define... with "List" as name, $Sample.$A$1:$B$19 as reference and first row as column headers. It includes the whole assumed list including the yet empty cells.
I repeat all the above tests, append "eight" and 8, do it again and everything sorts just perfectly, but now selecting the whole defined data range A1:B19.
I clear some values in both columns and everything sorts as expected.
Completely empty rows are excluded from sorting. They always stick at the bottom of the list whereas empty values with associated neigbour values are sorted (empty is considered larger than any number or text, all text is larger than any number).

The developers did a very good job when they newly implemented the spreadsheet sorting after so many years of valid complaints. One embarrassing error issue 101690 slipped in, though. But that bug has nothing to do with the constant values in this example.

Re: OOo 3.1 - Sort in reverse order

Posted: Mon Jun 29, 2009 12:14 pm
by Villeroy
P.S. and off-topic:
Demo of the stable sorting, introduced in v3.1:

Randomly sorted integers:

Code: Select all

1	2	4	10
0	1	3	8
1	3	7	15
0	1	3	7
0	0	0	2
0	0	1	3
1	2	5	12
0	0	0	1
1	3	6	13
1	2	4	9
1	3	6	14
1	3	7	16
0	0	1	4
0	1	2	6
0	1	2	5
1	2	5	11
Activate a cell in column #1 and sort, then sort column #2, #3 and #4.
The result is a sort order by more than three columns:

Code: Select all

0	0	0	1
0	0	0	2
0	0	1	3
0	0	1	4
0	1	2	5
0	1	2	6
0	1	3	7
0	1	3	8
1	2	4	9
1	2	4	10
1	2	5	11
1	2	5	12
1	3	6	13
1	3	6	14
1	3	7	15
1	3	7	16

Re: OOo 3.1 - Sort in random order

Posted: Mon Jun 29, 2009 7:36 pm
by andyqkw
Numbers sorts fine for single column sorting. But for text, the first row/column is ignored.

This issue was mentioned in this thread http://user.services.openoffice.org/en/ ... =9&t=19681 and others as well...

It's a shame that OOo was not able to release a patch file for this problem instead of having users waiting till Aug 09 or even later for 3.1.1 to be released.

Re: OOo 3.1 - Sort in reverse order

Posted: Mon Jun 29, 2009 7:49 pm
by Villeroy
If your list is not supposed to have column labels, define a database range and unckeck "Contains column labels" and use the menu command. I'd simply add column labels. They don't hurt.

Re: OOo 3.1 - Sort in reverse order

Posted: Mon Jun 29, 2009 10:34 pm
by acknak
I must be missing something: I don't understand why we're running around in circles here.

I can't reproduce any problem using the "Sample.xls" file that was attached here. Does anyone see a problem with that file? If so, what exactly?
andyqkw wrote:This issue was mentioned in this thread...
Sorry, but as I understand the situation, that is an entirely separate problem with sorting in OOo 3.1. That problem only affects sorting cells that contain formulas. Your sample file contains only static (unchanging) data (excepting the total cell, which I assume is not part of area you want to sort).

Can someone (andyqkw?) please provide a sample file, and/or instructions to reproduce the problem? A description or screenshots like Gurkha's might be helpful also. If someone's already done that, and I just missed it, then I apologize up front ;-)