Logical Operators

More complex queries will require that multiple filters be chained together as is the case for constructing:

  • All who did/have any of these events/properties ...
  • All who did/have all of these events/properties ...
  • All who did/have all of these events/properties in order ...

Here's how we break the above queries down into filter attributes:

EnglishFilter Code
All who did/have
any of thesetype: "or"
all of thesetype: "and"
all of these in ordertype: "then"
events/properties ...operands: [...]

It should be noted that date ranges within "then"-type Logical Operators are ignored.

Logical Operators Example

{
  "type": "and",
  "operands": [
    {
      "type": "event",
      "negate": false,
      "event": 123,
      "frequency_occurrence": "at_least",
      "frequency_value": 1
    }
  ],
  "date_range": {
    "date_range_id": "last_7_days"
  }
}

Logical Operators Attributes

Attributerequired/optionalvalue
typerequired"and", "or", "then"
operandsrequiredArray of Filter Objects
date_rangeoptionalDate Range Object