Description: I have this function on my sheet: SORT(FILTER(CHOOSE({1.2};$'Master log of records'.$B$5:$B$10033;$'Master log of records'.$A$5:$A$10033);$'Master log of records'.$B$5:$B$10033=B29;"NULL");2;-1) It works fine, when FILTER results in at least two and more rows, but when that underlying FILTER table results in only 1 entry, it returns err504. I tested that with excel and it works fine there. It is really strange. It works normally if I use: =CONCATENATE("QF-004-002"; " / "; RIGHT(IFNA(VLOOKUP(B30;SORT(FILTER(CHOOSE({1.2};$'Master log of records'.$B$5:$B$10045;$'Master log of records'.$A$5:$A$10045);$'Master log of records'.$B$5:$B$10045=B30;{"NULL";"NULL"});2;-1);2;FALSE());" ");3)) i.e. two-dimensional array for "result if empty" parameter. version 24.8.2.1 Thanks a lot. Steps to Reproduce: Please, use the complex function described in description section. See attached file. Actual Results: err504 with that function. I will attach file for ease of testing as it is difficult to describe input and results. Expected Results: I expect not err504, but correctly formatted string. Reproducible: Always User Profile Reset: No Additional Info: I have attached the file. First sheet, first column, you can see variable results of this evaluation. Regarding attached file: Idea is to display on first sheet, first column: document_number / last_number_used, i.e. like QF-004-001 / 002. That simply means that QF-004-001 is just a number of template and all derivatives are numbered with suffix like QF-004-001-001, QF-004-001-002 etc. Second sheet has all them (derivatives) listed. So I would like to have last no used on the first sheet next to the base document name. I do that by concatenating multiple strings of document number itself and then doing filtered (with swapped columns), sorted vlookup. This result is used with right function to get required symbols, i.e. end number of document. Forum suggested answer here: https://ask.libreoffice.org/t/sort-function-breaks-and-shows-err504-with-a-single-row-as-a-result/112713
Created attachment 197206 [details] test document to see the error.
I double checked, but =CONCATENATE("QF-004-002"; " / "; RIGHT(IFNA(VLOOKUP(B30;SORT(FILTER(CHOOSE({1.2};$'Master log of records'.$B$5:$B$10045;$'Master log of records'.$A$5:$A$10045);$'Master log of records'.$B$5:$B$10045=B30;{"NULL";"NULL"});2;-1);2;FALSE());" ");3)) Also does not work. I was wrong. It produced incorrect result.
Created attachment 197239 [details] Simplified example The given example and the contained formula are (imo) by far too complex to clearly show the bug. Therefore I attach a simplified example also containing the case that SORTBY() is used.
Balazs Varga committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/bafe4102742d2a3e2f5d81ba498035d2eefce371 tdf#163592 - sc fix Sort/SortBy function shows err504 instead of results It will be available in 25.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Balazs Varga committed a patch related to this issue. It has been pushed to "libreoffice-25-2": https://git.libreoffice.org/core/commit/a8fa1484a066731a6a75fe36c577737ee088ca59 tdf#163592 - sc fix Sort/SortBy function shows err504 instead of results It will be available in 25.2.2. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Balazs Varga committed a patch related to this issue. It has been pushed to "libreoffice-24-8": https://git.libreoffice.org/core/commit/574ee6527e1d1c3ef08bc0bbe91bbc2673a3b8e6 tdf#163592 - sc fix Sort/SortBy function shows err504 instead of results It will be available in 24.8.6. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.