Skip to content

Conditional measures

justjkk edited this page Jan 22, 2012 · 1 revision

Conditional Measures

Syntax

  • In the mapping definition for measure, "conditions" is an array that takes any number of condition objects
  • Each condition object has exactly two keys. One of the keys is field and the other should be one of the following:
    • equals
    • not_equals
  • If more than one condition is given, ALL the conditions must be true for the measure to be affected

Example definition

...
"discounted_tickets_sold": {
  "type": "count",
  "resource": "ticket_events",
  "conditions": [
    {
      "field": "event",
      "equals": "sold"
    },
    {
      "field": "type",
      "equals": "discounted"
    }
  ]
}
...
Clone this wiki locally