TODAY learn how to bring Drag & Drop to Dash with Dashboard Engine. 🌠 Sign up for the live event!

How to implement data table backend filtering with logical operators?

Right now my dash app is basically using the Connecting Backend Paging with a Graph example from the standard dash app examples.

What this filtering misses though is the option to use logical operators in a filtering query, e.g. if you would like to get the rows that contain the words “Belgium” and “Bolivia” you would want to do a query that reads like contains Belgium OR Bolivia.

I thought before I make the effort to implement this myself I better ask around if something like this was already implemented by someone else?

Or if not logical operators then did someone manage to implement something like an “IN” statement in SQL?

http://dash.plotly.com/datatable/filtering shows multiple simple filtering examples run in the client and on the server, as well as more advanced usages using the prop derived_filter_query_structure to create, for example, a pandas filter and some example of the full extent of the query syntax (e.g. (({pop} ge 100000000 and {pop} le 500000000) or {country} eq "Singapore") and {continent} eq "Asia" is a perfectly valid filter_query)

That said the DataTable does not currently offer an in operator and the closest equivalent is using as many blocked or like `({country} == ‘Bolivia’ || {country} == ‘Belgium’)