perspective icon indicating copy to clipboard operation
perspective copied to clipboard

Add possibility to negate / invert ends with filter

Open 0x26res opened this issue 1 year ago • 1 comments

Feature Request

Description of Problem:

I have a table containing an id field, of type string.

I want to filter out any id that ends with a given string.

At the moment I'm only able to filter in / select id that ends with a given string.

Potential Solutions:

I can think of a few solutions:

  • allow any filter to be negated
  • add a "not ends with" filter (and do the same with starts with)
  • add a regex filter

0x26res avatar Apr 17 '24 17:04 0x26res

We may add something like this in the future, for now you can achieve this by filtering on an Expression Column, e.g. for this config from our superstore example :

{
  "version": "2.10.0",
  "plugin": "Datagrid",
  "columns": [
    "State",
    "State Filter Column"
  ],
  "filter": [
    [
      "State Filter Column",
      "==",
      true
    ]
  ],
  "expressions": {
    "State Filter Column": "match(\"State\", '(as$)')"
  },
}

https://github.com/finos/perspective/assets/60666/3208f6be-ae3c-427f-94ab-9dc1499976b4

texodus avatar Apr 17 '24 20:04 texodus