finos / perspective

A data visualization and analytics component, especially well-suited for large and/or streaming datasets.
https://perspective.finos.org/
Apache License 2.0
7.72k stars 1.04k forks source link

Add possibility to negate / invert ends with filter #2592

Open 0x26res opened 2 months ago

0x26res commented 2 months ago

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:

texodus commented 2 months ago

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