[Solved] Sorting differences OO-3 vs OO4

Discuss the spreadsheet application
Post Reply
ozzie_traveller
Posts: 28
Joined: Sun Dec 07, 2008 11:57 am

[Solved] Sorting differences OO-3 vs OO4

Post by ozzie_traveller »

G'day all

Recently swapped to OOv4

I have noticed a strange difference in sorting a column of data
Presume we have a column of 99 data elements [names for example]

OO-V3
Highlight all 99 cells; click toolbar icon to sort > all sorts okay

OO-v4
ditto above ... Row 1 is not sorted, rows 2-99 are sorted
if I then highlight all 99 cells including the space above Row-1 [ie- 100 rows]; click icon to sort > all sorts okay

Is it me, or is there an issue?
Phil
Last edited by RoryOF on Tue Sep 23, 2014 7:39 pm, edited 2 times in total.
Reason: Added green tick. [RoryOF, Moderator]
AOO-4.0.0.m3(9702) on Ms Windows 7-32 SP1
Alex1
Volunteer
Posts: 853
Joined: Fri Feb 26, 2010 1:00 pm
Location: Netherlands, EU

Re: Sorting differences OO-3 vs OO4

Post by Alex1 »

In the Sort window on the Options tab you can check whether the first row contains column labels and shouldn't be included in the sorting. Calc tries to determine from the contents if the first row contains headers and sets the option accordingly, an algorithm which might be different between versions.
AOO 4.1.16 & LO 25.8.3 on Windows 10
Richarda44
Posts: 351
Joined: Sat May 24, 2008 6:59 pm

Re: Sorting differences OO-3 vs OO4

Post by Richarda44 »

It seems unchecking the Sort > Options column label box only works once and then it ticks itself so the top row is left unsorted. Seems a bit like educating children - you have to tell them every time ;) Perhaps there is another way to turn off this "default" behaviour?

Richard
OOo 4.1.1. bld 9593 on MS Windows 10 64 SP1 Chillblast fusion i5 and Acer Aspire E1-572 Laptop

There's got to be a better way
And for all accountants - The change is coming
User avatar
Villeroy
Volunteer
Posts: 31365
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Sorting differences OO-3 vs OO4

Post by Villeroy »

Simply add a column header.

OR:
Data>Define...
give a name to the list
[MoreOptions]
Uncheck column labels
Then do the sorting via Data>Sort... only once.

Every time when you modified cells or inserted new cells call Data>Refresh to refresh the list with previously set sort order.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Richarda44
Posts: 351
Joined: Sat May 24, 2008 6:59 pm

Re: Sorting differences OO-3 vs OO4

Post by Richarda44 »

Hi Villeroy

The tick box for column labels keeps getting ticked after I untick it. Why will it not accept my unticking when I define the single column range with only letter data? Behaviour also seems to change if there is more than one column.

I know "mother knows best" but I'm just curious :? My version is still 3.4.1

Richard
OOo 4.1.1. bld 9593 on MS Windows 10 64 SP1 Chillblast fusion i5 and Acer Aspire E1-572 Laptop

There's got to be a better way
And for all accountants - The change is coming
User avatar
Villeroy
Volunteer
Posts: 31365
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Sorting differences OO-3 vs OO4

Post by Villeroy »

The 2 quick-sort buttons on the standard toolbar [A-Z] and [Z-A] work like this:

1a) If a single cell is selected, the current region around this cell gets sorted. The current region is the area of adjacent non-blanks; a rectangle bordered by empty rows and columns. Beyond the adjacent emtpy rows and columns there may be other data that won't be included.
1b) If a range of more than one cell is selected, this range will be sorted. If that range is within the current region, a warning is thrown if you really want to sort a sub-area of the current region.
1c) If anything else is selected (multiple areas or drawing objects) the commands are disabled anyway

2) If the first row is filled with text values without blanks nor numbers, this row of values is taken as column labels and remains unsorted on top of the list. Any blank or number disqualifies the top row as column labels.

3) The currently active cell determines the sort field.

4) The cells will be sorted by the column with the active input cell. When there are duplicates in the sort column, the sort algorithm preserves the previously found order of rows within the subrage of equal sort values.

5) Select the sorted range including any column headers.

The detection of what to be sorted and if there are any column labels or not occurs every time you hit the sort button. The detection overrides any previous setting in the sort dialog or in the database range dialog.
Between step 1) and 2) I'd like to have an additional step: Detect if the found sort area intersects with a defined database range with the very same top row and check if this database range is defined with column labels or not.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
ozzie_traveller
Posts: 28
Joined: Sun Dec 07, 2008 11:57 am

Re: Sorting differences OO-3 vs OO4

Post by ozzie_traveller »

G'day mate

Thanks for a great reply - very comprehensive

I didn't realise about 1a) - 1b) or 1c)

Step 2 is where I have come undone ... sorting a list of people's names ~ but now I'll highlight one extra row above the 1st name and it will do the job

I will also close this thread - again Thanks
Phil
AOO-4.0.0.m3(9702) on Ms Windows 7-32 SP1
Richarda44
Posts: 351
Joined: Sat May 24, 2008 6:59 pm

Re: [solved] Sorting differences OO-3 vs OO4

Post by Richarda44 »

;) Thanks Villeroy

That all sounds helpful design.

But what I can't understand is when defining a database range with the label box unchecked it does not allow this so-called option. I suppose a database range HAS to have a top row of labels by definition. But why then the option?

I appreciate you would rather not use spreadsheets like databases ;)

Richard
OOo 4.1.1. bld 9593 on MS Windows 10 64 SP1 Chillblast fusion i5 and Acer Aspire E1-572 Laptop

There's got to be a better way
And for all accountants - The change is coming
User avatar
Villeroy
Volunteer
Posts: 31365
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] Sorting differences OO-3 vs OO4

Post by Villeroy »

I suppose a database range HAS to have a top row of labels by definition. But why then the option?
When the database range is bound to a data source (a registered database document), data always arrive with column labels; the column labels option is cheked and disabled.
The data source is indicated at the bottom of the db-range dialog below [More Options]. But then you are not limited to Calc's sort options anyway.

When I select an arbitrary cell range and define a new database range from the selected cells, the labels option is availlable.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Richarda44
Posts: 351
Joined: Sat May 24, 2008 6:59 pm

Re: [Solved] Sorting differences OO-3 vs OO4

Post by Richarda44 »

Thanks for your patience - wish I knew more about databases !

Richard
OOo 4.1.1. bld 9593 on MS Windows 10 64 SP1 Chillblast fusion i5 and Acer Aspire E1-572 Laptop

There's got to be a better way
And for all accountants - The change is coming
Post Reply