Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
vogievetsky opened this issue Oct 28, 2015 · 1 comment
Closed

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

vogievetsky opened this issue Oct 28, 2015 · 1 comment
Labels

Comments

@vogievetsky
Copy link
Contributor

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

@fjy
Copy link
Contributor

fjy commented Jan 26, 2016

Fixed by #1936

@fjy fjy closed this as completed Jan 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants