Filter

 

Foreword

Example: (visit equal to 19) AND (device type equal to Tablet or Desktop) AND (source start by Referrer )

 
 

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
 

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

 

Last update: 04/05/2021