Text-filter: using keywords for and/or filtering

Hi,
I would like to ask two questions related to how to use text-filter function.

  1. As shown in a topic in Filters | Datagrok, I would like to use multiple keywords for and/or search. Is this function still available in the current version? Unfortunately I couldn’t find it.

  2. I checked how to use free text filter shown in Can we filter rows by substring - #3 by skalkin. I checked that I can filter by and/or condition such as prop1 startswith A and prop2 contains B. Are there any other methods other than startswith and contains? Besides, can I use regex in free-text-filter funtion?

Any comments and information are well appreciated.

Hi Kosuke,
I think you couldn’t use the filter because the corresponding column didn’t have the required tag: quality = Text

TextFilter

1 Like

Thank you for sharing how to execute. I confirmed I can do the same and/or text filter.

1 Like

Currently we try to detect the “Text” type (as opposed to categories that are more commonly used in tabular data) automatically, but indeed sometimes you want to force it. What Olena described is more like a workaround, we’ll make it more intuitive.

Are there any other methods other than startswith and contains? Besides, can I use regex in free-text-filter funtion?

Yes, you can use regex, and there are more additional options! We were not advertising this particular filter because it’s still not polished and there are some known bugs present, but if you found it already, here’s how you can use right now (bugs are being fixed):

Free-text filter

Free-text filter lets you enter custom search terms. Typically, search terms
have a form of column name operation value. The following operations are supported:

  • numerical columns: none, =, !=, >, <, >=, <=, in, not in, -, is null, is not null
    • age > 40
    • height is null
  • string columns: none, contains, starts with, ends with, equals, !=, regex, in, not in, is null, is not null
    • race contains sian // Asian, Caucasian
    • race starts with B
    • race in (Black, Asian)
    • race regex ck$
  • datetime columns: none, equals, before, after, range, is null, is not null
    • started after 7/1/1991
  • bool columns: true, false

Conditions

Free-text filter also understands (very basic) logical conditions. Here are some examples:

  • age > 30 and height > 190
  • age > 30 and sex = F

Unfortunately, at the moment free-text filter does not work with columns that have space in the name.
We are working on developing another filter that would let you specify column/operation/value in a more structured form.

@lbankurova , let’s also document our filtering functionality better, there are many features and options but currently it’s hard to find them. Of course we’ll make it easier to find too :slight_smile:

2 Likes