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
This is part of Plywood/PlyQL and is currently being done using
javascriptNote: 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 <= upperbut should be configurable