Bug 161642 - output range of SORT function does not expand when source range becomes larger
Summary: output range of SORT function does not expand when source range becomes larger
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on: 127808
Blocks: Sorting
  Show dependency treegraph
 
Reported: 2024-06-18 21:29 UTC by Regina Henschel
Modified: 2024-07-31 11:15 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
SORT function on database range (29.88 KB, application/vnd.oasis.opendocument.spreadsheet)
2024-06-18 21:29 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2024-06-18 21:29:24 UTC
Created attachment 194808 [details]
SORT function on database range

If the SORT function is based on a database range and the content of the database range becomes larger, then the output range of the SORT function does not expand to the new size of the source range.

Recalculate Hard does not expands the output range of the SORT function. There is even no adaption, when the file is saved and reloaded.

How to reproduce:
Open attached file. It has formula SORT(Members_data;2) and Members_data=$Sheet1.$A$2:$B$10.
Insert an entry in the green area between row 5 and 6 e.g. "Tim Hof". Verify in Data > Define Range, that it is now Members_data=$Sheet1.$A$2:$B$11.

The new entry is visible in the output of the SORT function, but the output range does not expand, so the entry "Eva Waldeck" is no longer visible.

Save and reload the file. The output range is still wrong although the formula is {=SORT(Members_data;2)} and Members_data=$Sheet1.$A$2:$B$11
Comment 1 m_a_riosv 2024-06-19 14:36:37 UTC
I think the problem is the formula converted to an array {} formula.
If I remember correctly, a similar situation happened with some recent new functions.
BTW the file does not work in Excel, only for the formula as array {}.

It seems that the implementation of dynamic arrays, is pending.
Comment 2 ady 2024-06-19 16:49:11 UTC
(In reply to m_a_riosv from comment #1)
> It seems that the implementation of dynamic arrays, is pending.

Of course dynamic arrays has not been implemented in Calc yet. New Calc functions for compatibility with Excel 2021 were recently implemented (and possibly still some issues may arise). But the whole set of "Dynamic arrays" features is much bigger than adding a couple of functions. There are syntax changes (or additions), new error codes/messages, automatic resize of arrays (both for input data and results)...
Comment 3 Regina Henschel 2024-06-25 18:17:29 UTC
The SORT function calculates the whole array, but uses the existing range. This can indeed only be solved, when the "dynamic array" feature is implemented. I therefore add a dependency to the corresponding feature request in bug 127808.