Bug 142522 - Filter By Color: allow multiple selection
Summary: Filter By Color: allow multiple selection
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.2.0.0 alpha1+
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 142761 150077 (view as bug list)
Depends on:
Blocks: AutoFilter-Color
  Show dependency treegraph
 
Reported: 2021-05-27 08:29 UTC by Kevin Suo
Modified: 2023-06-12 11:09 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
automatic filter menu - colors (45.34 KB, image/jpeg)
2021-05-27 13:32 UTC, kabilo
Details
Example file from Excel (8.80 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2021-05-28 13:05 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Suo 2021-05-27 08:29:48 UTC
The new filter-by-color feature implemented on master is great, but it currently only support to select one color at a time.

It will be useful if multiple selection is supported.

Steps to Reproduce:

1. Produce the following sample content in Calc:
col1    col2
a       1
b       2
c       3

2. Mark 1 to yellow and 3 to red.
3. Set autofilter, click on the dropdown, click "background color", select the yellow color.

Current Result:
When you select the yellow color, the dialog is closed and the result is filtered. We are not able to select both yellow and red.

Expected Behaviour:
When you select the yellow color, the dialog remains open to allow to select also red.
Comment 1 kabilo 2021-05-27 13:30:11 UTC
I agree and attach a screen from MSO for inspiration. I would also like to see the checkbox when a filter is active (background color, text color or standard filter). Now you need to look at all the options to see if any are active.
Comment 2 kabilo 2021-05-27 13:32:04 UTC
Created attachment 172392 [details]
automatic filter menu - colors
Comment 3 NISZ LibreOffice Team 2021-05-28 13:05:06 UTC
Created attachment 172406 [details]
Example file from Excel

My Excel 2019 does not allow two background or text colors to be used as filter, see in this example file.

Allowing filtering with two colors could cause interoperability issues such as losing one of the filtering colors on XLSX saving or invalid XLSX (since Excel does not allow two colors, it would likely freak out from seeing two colors as filter criteria and ditch the complete autofilter).

So this overall idea is a -1 from me.

Cheers
Gabor
Comment 4 Heiko Tietze 2021-05-28 13:22:22 UTC
The checkboxes (that's what I get with kf5, at least) indicate a multi-selection. And yes, it would be nice to have. If the implementation is too difficult we should change the feedback and make it either a radio button or use some checkmark for the active option.
Comment 5 Kevin Suo 2021-05-28 14:09:20 UTC
(In reply to NISZ LibreOffice Team from comment #3)

> My Excel 2019 does not allow two background or text colors to be used as filter, see in this example file.

> Allowing filtering with two colors could cause interoperability issues such as losing one of the filtering colors on XLSX saving or invalid XLSX

Yes, you are absolutely right. My bad.

Then I will close this bug as WONTFIX.

> The checkboxes indicate a multi-selection. ... we should ...  make it either a radio button or use some checkmark for the active option.

Yes this is what I want to claim.
Comment 6 Roman Kuznetsov 2021-05-28 14:20:23 UTC
Why wontfix at once? Let's get some opinions and ask Samuel
Comment 7 Heiko Tietze 2021-06-11 08:04:12 UTC
*** Bug 142761 has been marked as a duplicate of this bug. ***
Comment 8 Samuel Mehrbrodt (allotropia) 2021-06-28 11:42:30 UTC
As Gabor mentioned, multiple selection is not supported in XLSX.

If we want this, we need to consider this in the ODF proposal.
The current implementation assumes that there is only one active color in the filter.

Please join the discussion at https://issues.oasis-open.org/browse/OFFICE-4107 if you think ODF should support this (also adding Regina and Michael S to CC since they are discussing that proposal).
Comment 9 Michael Stahl (allotropia) 2021-06-29 08:54:02 UTC
i think this could easily be implemented in ODF filter because ODF already has these filter-or and filter-and elements that don't care if the condition inside them is a string match or a color... but i have no idea about XLSX

  <rng:define name="table-filter">
    <rng:element name="table:filter">
      <rng:ref name="table-filter-attlist"/>
      <rng:choice>
        <rng:ref name="table-filter-condition"/>
        <rng:ref name="table-filter-and"/>
        <rng:ref name="table-filter-or"/>
      </rng:choice>
    </rng:element>
  </rng:define>
  <rng:define name="table-filter-and">
    <rng:element name="table:filter-and">
      <rng:oneOrMore>
        <rng:choice>
          <rng:ref name="table-filter-or"/>
          <rng:ref name="table-filter-condition"/>
        </rng:choice>
      </rng:oneOrMore>
    </rng:element>
  </rng:define>
  <rng:define name="table-filter-or">
    <rng:element name="table:filter-or">
      <rng:oneOrMore>
        <rng:choice>
          <rng:ref name="table-filter-and"/>
          <rng:ref name="table-filter-condition"/>
        </rng:choice>
      </rng:oneOrMore>
    </rng:element>
  </rng:define>
Comment 10 Mike Kaganski 2021-06-29 10:36:15 UTC
(In reply to Michael Stahl (allotropia) from comment #9)
> about XLSX

> <xsd:complexType name="CT_FilterColumn">
>     <xsd:choice minOccurs="0" maxOccurs="1">
>         <xsd:element name="filters" type="CT_Filters" minOccurs="0" maxOccurs="1"/>
>         <xsd:element name="top10" type="CT_Top10" minOccurs="0" maxOccurs="1"/>
>         <xsd:element name="customFilters" type="CT_CustomFilters" minOccurs="0" maxOccurs="1"/>
>         <xsd:element name="dynamicFilter" type="CT_DynamicFilter" minOccurs="0" maxOccurs="1"/>
>         <xsd:element name="colorFilter" type="CT_ColorFilter" minOccurs="0" maxOccurs="1"/>
>         <xsd:element name="iconFilter" minOccurs="0" maxOccurs="1" type="CT_IconFilter"/>
>         <xsd:element name="extLst" type="CT_ExtensionList" minOccurs="0" maxOccurs="1"/>
>     </xsd:choice>
>     <xsd:attribute name="colId" type="xsd:unsignedInt" use="required"/>
>     <xsd:attribute name="hiddenButton" type="xsd:boolean" use="optional" default="false"/>
>     <xsd:attribute name="showButton" type="xsd:boolean" use="optional" default="true"/>
> </xsd:complexType>

So colorFilter may only appear once under CT_FilterColumn, and also it can't appear elsewhere.
Comment 11 Regina Henschel 2021-08-22 23:19:02 UTC
I think this is connected to the request to allow color filter in Standard-Filter (bug 143103) because the latter has already the option in the UI to define several conditions. If color in Standard-Filter is implemented, then it might be not necessary to allow multi-selection in the UI of Autofilter.

LibreOffice is not a clone of Excel. The fact, that Excel does not have a feature is no reason, that LibreOffice does not get it too. For me this is a valid enhancement request.
Comment 12 Samuel Mehrbrodt (allotropia) 2021-09-20 09:26:25 UTC
This should work with the fix from bug 143103 using the "Standard Filter" dialog.
Please retest.

Not sure if the simple dropdown should support this too, maybe it's enough to have this feature in the Standard Filter dialog to keep the dropdown simple.
Comment 13 Heiko Tietze 2022-07-25 13:39:20 UTC
*** Bug 150077 has been marked as a duplicate of this bug. ***
Comment 14 Heiko Tietze 2022-07-25 13:40:05 UTC
Version: 7.5.0.0.alpha0+ / LibreOffice Community
Build ID: cae349e4770862b36176b601d7d572844c215d4f
CPU threads: 8; OS: Mac OS X 12.4; UI render: Skia/Raster; VCL: osx
Locale: en-US (en_DE.UTF-8); UI: en-US
Calc: threaded

still shows radio buttons and allow only single selection.
Comment 15 Samuel Mehrbrodt (allotropia) 2023-04-27 10:23:36 UTC
(In reply to Heiko Tietze from comment #14)
> Version: 7.5.0.0.alpha0+ / LibreOffice Community
> Build ID: cae349e4770862b36176b601d7d572844c215d4f
> CPU threads: 8; OS: Mac OS X 12.4; UI render: Skia/Raster; VCL: osx
> Locale: en-US (en_DE.UTF-8); UI: en-US
> Calc: threaded
> 
> still shows radio buttons and allow only single selection.

Please read comment 12.
Comment 16 Heiko Tietze 2023-06-12 11:09:26 UTC
*** Bug 150077 has been marked as a duplicate of this bug. ***