Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SIP-124] Add a text filter working as "like" to allow user to filter as dashboard_filter (generic solution) or as table_filter (specific solution) #27666

Closed
nigzak opened this issue Mar 26, 2024 · 9 comments
Labels
sip Superset Improvement Proposal

Comments

@nigzak
Copy link
Contributor

nigzak commented Mar 26, 2024

[SIP-124] Proposal for add a text filter working as "like" to allow user to filter as dashboard_filter (generic solution) or as table_filter (specific solution)

Motivation

If you have a bigger raw table in superset including a text value there is no good option available to search for a dedicated value in this table.

Constructed example (maybe bad as example, only for demonstrate the motivation):
There are values in the text value in table in column MY_COL:


ex:

1_SOMETEXT_2
4_SOMETEXT_5
9BLA2
BLA   (no number)

and you want to filter in the table as example to (* as placeholder for "any" value)

*9_SOMETEXT_4*
*TEXT*
*9*
*A*

There is no good way to filter in this way in the table.

Other example:

lets say you have a list of trackingids which are TEXT
some persons enter there userid as prefix (ex: USER1, concreate example USER1XYZTESTWHATEVER)
USER1 wants to filter in the table to his values so he wants a filter for %USER1% (also possible USER1%)

Proposed Change

a) add a filter for dashboard
let the user add a textfield which works like he can enter a "value"
the table can filter in the way for

*{{value}}*

in the table to reduce the table rows

b) add a "table only" filter possibility to let the user enter some values in the table headers to filter (=no dashboard filter, more a chart filter) like he can click on a column (to be defined: how to separate between "order" and "enter value, might be "on text = order", "right_to_text=box appears") to enter a "value"
a small textbox would appear where he can "click" to enter a text which filters the dedicated column like

 *{{value}}*

// hint to the value

*{{value}}*

in SQL syntax would mean to work in a way as "like %value%" (search for ANY match in the string)
If we allow the "%" and the "_" also (or * as replacement) as a search keyword it might be also possible to search for all combinations like

exact (value) or non-exact (%value, value%, %value%, _value, ... and so on)

New or Changed Public Interfaces

VAR a) new "text filter" on dashboard level
VAR b) change to table to add a text filter only there

Hint: in principle there might be also reasons to have also a global filter for other reasons than only a raw table, similar to a KIBANA to search for a dedicated value to reduce multiple dashboards

ex:

data
<n:m>
dependencies

(1 data can have multiple (m) dependencies, 1 dependency can have multiple data (n) => n:m )

dashboards with charts depending rows to dependencies
there are valid reasons that a user wants to fitler ALL charts to dedicated data(s) 
to see only dependencies for one specific data (or a filtered subset) based on a text value

an example could bededicated trackingid(s)  
(refer up motivation => user trackingid example)

New dependencies

unknown

Migration Plan and Compatibility

unknown

Rejected Alternatives

no support to explicit search for some values

@nigzak nigzak added the sip Superset Improvement Proposal label Mar 26, 2024
@nigzak nigzak changed the title [SIP] add a data filter for "like" to allow user to filter in a table for matches as dashboard_filter or as table_filter [SIP] add a text filter working as "like" to allow user to filter in a table for matches as dashboard_filter or as table_filter Mar 26, 2024
@nigzak nigzak changed the title [SIP] add a text filter working as "like" to allow user to filter in a table for matches as dashboard_filter or as table_filter [SIP] add a text filter working as "like" to allow user to filter as dashboard_filter (generic solution) or as table_filter (specific solution) Mar 26, 2024
@rusackas rusackas changed the title [SIP] add a text filter working as "like" to allow user to filter as dashboard_filter (generic solution) or as table_filter (specific solution) [SIP-124] add a text filter working as "like" to allow user to filter as dashboard_filter (generic solution) or as table_filter (specific solution) Apr 3, 2024
@dacopan
Copy link
Contributor

dacopan commented Apr 4, 2024

could be a great plus also support wildcards for example (abc, abc, abc) and (-abc -def) for exclude words

@dacopan
Copy link
Contributor

dacopan commented Apr 4, 2024

same functionality could be usefull in filterbox in dashboard filters

@rusackas
Copy link
Member

rusackas commented Apr 4, 2024

There's a much older and discarded SIP that relates to this here: #8452

Historically, when a "LIKE" filter idea comes up, the subject of performance (particularly with large tables) usually ensues.

That older SIP had an interesting idea of adding a few options (perhaps a select dropdown) which could let you pick the matching criteria, e.g.:

contains => column LIKE '%value%'
does not contain => column NOT LIKE '%value%'
starts with => column LIKE '%value'
ends with => column LIKE 'value%'
is empty => column IS NULL
is not empty => column IS NOT NULL

@dacopan
Copy link
Contributor

dacopan commented Apr 5, 2024

I think that could be a two separated functionality, one as native filter as mention @rusackas and another inside tables in dashboard (related with #27645)

@rusackas
Copy link
Member

This sip needs to be moved forward to a DISCUSSION thread on the mailing list if it is to be considered.

@nigzak
Copy link
Contributor Author

nigzak commented Apr 28, 2024

Hi @rusackas

can you let me know how to do this?
Make a "copy" of it in discussion thread? I sadly did not find a button to move it to a discussion thread

@rusackas
Copy link
Member

First step is to subscribe to the Superset Dev mailing list, by sending an email to [email protected]. Once you're verified/subscribed, you can send an email to [email protected] with the [DISCUSS] subject and a link to this thread here.

Here's a recent example, available on the web-hosted mirror of the mailing
list:https://lists.apache.org/thread/6o0zkggo6b68nr362mgrrdzt9k6odb9j

@rusackas
Copy link
Member

Oh, and once that's done and the discussion settles out, we can bring it up for a VOTE thread to make it official.

@john-bodley john-bodley changed the title [SIP-124] add a text filter working as "like" to allow user to filter as dashboard_filter (generic solution) or as table_filter (specific solution) [SIP-124] Add a text filter working as "like" to allow user to filter as dashboard_filter (generic solution) or as table_filter (specific solution) May 2, 2024
@nigzak
Copy link
Contributor Author

nigzak commented May 21, 2024

Found a workaround for me which I did not know:
you can add a "text filter" on a table on customize => search box

For me currently it works - still it might be a good point to in general think about an idea how to solve this.
If the table fetches more than 10k (max) this option will probably not work ...

(would have add pictures - GIT does not let me add pictures currently, "file type not supported")

@nigzak nigzak closed this as completed May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sip Superset Improvement Proposal
Projects
Status: Denied / Closed / Discarded
Development

No branches or pull requests

3 participants