Filter

 

Foreword

See Postman example

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
$inArray
$gtGreater than
$gteGreater or equal to
$ltLower than
$lteLower 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
$inArray
$lkContains
$nlkDoes not contain
$startStart with
$nstartDoes not start with
$endEnd 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
$ltLower than
$lteLower or equal to
 

Filter on boolean

PARAMETERDESCRIPTION
$eqEquals to
$neqDoes not equal
$natrue or false – NULL value
$undefinedtrue or false – undefined
$emptytrue or false – combinaison of $na and $undefined

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"
        }
      }
    ]
  }
}

# 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"
        }
      }
    ]
  }
}

# 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"
        }
      }
    ]
  }
}

# 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"
        }
      }
    ]
  }
}