AutoFilter selection returns incorrect results

I have an Autofilter on my spreadsheet. This has been converted to an *.ods from Excel, where I’ve used this sheet with an AutoFilter for quite some time.

In selecting items I’m getting more results showing than I should. “2022+” is returning “2022” and “2022+”

Thanks.

Please upload a real, ods type sample file here instead of the image.

You have mixed numeric values and strings in the filtered column. Try to unify the values (the same formatting is not enough: use same types.)

Probably Calc should be able to handle mixed data types (e.g. All - General type). The number as a string must be a string, Calc may suggest changing this behavior.
What is in the picture is the result of incorrect behavior.

Thanks for all the feedback. I’m headed out for a week vacation and will get the *.ODS file to you later on. Sounds like there is both an error in Calc’s processing and an easy workaround.

Here’s an example file. Example.ods (36.7 KB)
One sheet is formatted Number - General and the second converted to Text.

@Zizi64 is correct that I had mixed numeric and strings — although the formatting is consistently Number - General. This file, which I’ve used for many years, was recently converted from Excel to Calc. The number type for this column in Excel was a General format. I enter the strings as '2022+ and the numbers without the single quote.

It’s simple enough to convert the column to Text format. However AutoFilter still shows both 2022 and 2022+ when selecting 2022+.

This would seem to be undesirable behavior for AutoFilter. A bug in other words. If I select text format for a column, I would expect that all values would be treated as text. Nothing else. Just straight text. :slight_smile: In my opinion this should be fixed.

@Zizi64 I appreciate the Style workaround. Being not familiar with Styles I will just change the 2022+ values to 2022++ or something else which does work correctly in AutoFilter.

Thanks,

Brad

Your sample file works as you expected in my LO6.1.6 and LO6.2.8 and LO6.4.6 versions.
I just tried in the LO7.3.0 version: the “bug” is present.

You can downgrade to a 6.x.x version, if this function is important for you:
https://downloadarchive.documentfoundation.org/libreoffice/old/

Very interesting. So it’s a relatively new bug in Calc. Do these get reported somewhere for potential resolution?

You can check it on the bugreport site:

https://bugs.documentfoundation.org/

Here is my sample file with column pre-formatted as Text by Cell style: MyText. When you type-in a new value into the column A, that will be recognized as a textual content, but not as a number.

Autofilter and data types.ods (9.3 KB)

1 Like

Autofilter and data types.ods (12.2 KB)


The AutoFilter is set like the author’s. AutoFilter ignores text value ‘2022+’. Standard filter does not display it. The data is mismatched.
The problem is not with the data types, but with the plus in the string ‘2022+’. Calc gets confused when it encounters a mathematical symbol.

Edit:
Correcting myself. AutoFilter: 2021, “2022+”. Calc displays an extra line: 2022. The standard filter shows a different criterion - only 2021 (the second criterion is lost). This is an error.

1 Like

Overgeneralization. Does not happen with 2022-

Does it somehow treat the criteria as regex?