Skip to content

Add a range filter option (for numeric dimensions and strings) #1879

@vogievetsky

Description

@vogievetsky

This is part of Plywood/PlyQL and is currently being done using javascript

SELECT COUNT(*) AS 'Count' FROM `people` WHERE `age` BETWEEN 18 AND 30

Note: age is a dimension

Right now I have to do:

{
  "type": "javascript",
  "dimension": "age",
  "function": "function(a) { a = Number(a); return 18 <= a && a < 30; }"
}

Sometimes I have to filter on a range of string values like so:

{
  "type" : "javascript",
  "dimension" : "name",
  "function" : "function(x) { return(x >= 'bar' && x <= 'foo') }"
}

I would love it if you could add a between filter

Something like:

{
  "type": "between",
  "dimension": "age",
  "lower": 18,
  "upper": 30
}

The bounds to default to lower <= x <= upper but should be configurable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions