Filter
Foreword
If you want to filter your dataset, you have to use the filter
object. You can filter on both properties and metrics.
Filter on number
Parameter | Description |
---|---|
$eq | Equals to |
$neq | Does not equal to |
$in | Array |
$gt | Greater than |
$gte | Greater or equal to |
$lt | Less than |
$lte | Less than or equal to |
$na | true or false - NULL value |
$undefined | true or false - undefined |
$empty | true or false - combinaison of $na and $undefined |
Filter on string
Parameter | Description |
---|---|
$eq | Equals to |
$neq | Does not equal to |
$in | Array |
$lk | Contains |
$nlk | Does not contain |
$start | Starts with |
$nstart | Does not start with |
$end | Ends with |
$nend | Does not end with |
$na | true or false - NULL value |
$undefined | true or false - undefined |
$empty | true or false - combinaison of $na and $undefined |
Filter on date
Parameter | Description |
---|---|
$eq | Equals to |
$gt | Greater than |
$gte | Greater or equal to |
$lt | Less than |
$lte | Less than or equal to |
Filter on boolean
Parameter | Description |
---|---|
$eq | Equals to |
$neq | Does not equal to |
$na | true or false - NULL value |
$undefined | true or false - undefined |
$empty | true or false - combinaison of $na and $undefined |
note
For all types of filters it is possible to filter on several values at the same time, for example if you want to make a “contains” filter with values “A” OR “B” OR “C” you can separate them by commas in an array "$lk": [ "A", "B", "C" ]
Examples
Example: (visit equal to 19) AND (device type equal to Tablet or Desktop) AND (source start by Referrer )
{
// ...
"filter": {
"metric": {
"m_visits": {
"$eq": 19
}
},
"property": {
"$AND": [
{
"$OR": [{
"device_type": {
"$in": ["Tablet","Desktop"]
}
}]
},
{
"visit_src": {
"$start": "Referrer"
}
}
]
}
}
// ...
}