Skip to main content

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

ParameterDescription
$eqEquals to
$neqDoes not equal to
$inArray
$gtGreater than
$gteGreater or equal to
$ltLess than
$lteLess than or equal to
$natrue or false - NULL value
$undefinedtrue or false - undefined
$emptytrue or false - combinaison of $na and $undefined

Filter on string

ParameterDescription
$eqEquals to
$neqDoes not equal to
$inArray
$lkContains
$nlkDoes not contain
$startStarts with
$nstartDoes not start with
$endEnds with
$nendDoes not end with
$natrue or false - NULL value
$undefinedtrue or false - undefined
$emptytrue or false - combinaison of $na and $undefined

Filter on date

ParameterDescription
$eqEquals to
$gtGreater than
$gteGreater or equal to
$ltLess than
$lteLess than or equal to

Filter on boolean

ParameterDescription
$eqEquals to
$neqDoes not equal to
$natrue or false - NULL value
$undefinedtrue or false - undefined
$emptytrue 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"
}
}
]
}
}
// ...
}