https://bugs.documentfoundation.org/show_bug.cgi?id=161763

            Bug ID: 161763
           Summary: sort gives unexpected result
           Product: LibreOffice
           Version: 24.2.4.2 release
          Hardware: All
                OS: Linux (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Calc
          Assignee: [email protected]
          Reporter: [email protected]

Description:
I get unexpected result when ordering a simple table using autofilter

Steps to Reproduce:
1. In the test file ('initial' tab), you'll see a table with 10 items and their
price. In the 2nd tab ('discount') the '50% Discount' column just calculates
half of the initial price. In both tabs, there is an autofilter applied to the
1st rows, and the items are sorted ascending by the first column ('#').

2. Our objective is to 'sort ascending' the items in the 'discount' tab
according to their final prices (i.e., column '50% Discount'), irrespective of
the sort order of the 'initial' tab.

3. Go to 'discount', and in the autofilter of the '50% Discount' column apply
'sort ascending'. 

Actual Results:
It works, and I put a values-only copy on the tab "should be". 

BUT... now if you go back to 'initial' tab and 'sort ascending' by 'Initial
Price', check again the '50% Discount' column of 'discount' tab ... it
changed!! (you can compare to the tab 'should be'). For example now the cell
with the chair (tab 'discount', cell C4) is being calculated using the price of
the pillow!! (tab 'initial', C2). 


Expected Results:
I expect that the 'discount' tab will not change, no matter how I sort the
table in 'initial' tab. 
I understand that '50% Discount' column in 'discount' tab is calculated using
'Initial Price' from 'initial' tab, but I am not really changing any data from
the 'initial' tab, only merely the way (order) it is shown, so I expect that
the 'discount' tab should also not change at all. Besides, the formulas are of
the type '=$initial.C2' which means that only the tab name is fixed, not the
column or the row, therefore I do not expect that it references always the same
address (which would be expected if I used '=$initial.$C$2').


Reproducible: Always


User Profile Reset: No

Additional Info:
Either is is an error or I am very wrong in my expectations. If it is an error,
it is a quite serious one because (in my probably wrong expectation) this is
something the user doesn't check often and gives for granted, I was only able
to detect it by chance... otherwise it would mean a pretty serious error and
headaches to find and understand. If I'm wrong please tell me what would be a
better practice for this (don't tell me 'put everything in the same tab', as it
would completely defeat the purpose of a multiple spreadsheet program)

Version: 24.2.4.2 (X86_64) / LibreOffice Community
Build ID: 420(Build:2)
CPU threads: 24; OS: Linux 6.5; UI render: default; VCL: qt5 (cairo+xcb)
Locale: en-US (en_US.UTF-8); UI: en-US
Ubuntu package version: 4:24.2.4~rc2-0ubuntu0.22.04.1~lo1
Calc: CL threaded

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to