query_segmentation_sum
Sum numeric expressions for events over time in Mixpanel to calculate revenue metrics, track cumulative totals, and aggregate quantitative values across specified time periods.
Instructions
Sum a numeric expression for events over time. Useful for calculating revenue metrics, aggregating quantitative values, and tracking cumulative totals across different time periods.
Input Schema
| Name | Required | Description | Default | 
|---|---|---|---|
| event | Yes | The event that you wish to get data for (single event name, not an array) | |
| from_date | Yes | The date in yyyy-mm-dd format to begin querying from (inclusive) | |
| on | Yes | The expression to sum per unit time (should result in a numeric value) | |
| project_id | No | The Mixpanel project ID. Optional since it has a default. | |
| to_date | Yes | The date in yyyy-mm-dd format to query to (inclusive) | |
| unit | No | Time bucket size: 'hour' or 'day'. Default is 'day' | |
| where | No | An expression to filter events by based on the grammar: <expression> ::= 'properties["' <property> '"]' | <expression> <binary op> <expression> | <unary op> <expression> | <math op> '(' <expression> ')' | <string literal> <binary op> ::= '+' | '-' | '*' | '/' | '%' | '==' | '!=' | '>' | '>=' | '<' | '<=' | 'in' | 'and' | 'or' | <unary op> ::= '-' | 'not' | |
| workspace_id | No | The ID of the workspace if applicable | 
Input Schema (JSON Schema)
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "additionalProperties": false,
  "properties": {
    "event": {
      "description": "The event that you wish to get data for (single event name, not an array)",
      "type": "string"
    },
    "from_date": {
      "description": "The date in yyyy-mm-dd format to begin querying from (inclusive)",
      "type": "string"
    },
    "on": {
      "description": "The expression to sum per unit time (should result in a numeric value)",
      "type": "string"
    },
    "project_id": {
      "description": "The Mixpanel project ID. Optional since it has a default.",
      "type": "string"
    },
    "to_date": {
      "description": "The date in yyyy-mm-dd format to query to (inclusive)",
      "type": "string"
    },
    "unit": {
      "description": "Time bucket size: 'hour' or 'day'. Default is 'day'",
      "enum": [
        "hour",
        "day"
      ],
      "type": "string"
    },
    "where": {
      "description": "An expression to filter events by based on the grammar: <expression> ::= 'properties[\"' <property> '\"]'\n                | <expression> <binary op> <expression>\n                | <unary op> <expression>\n                | <math op> '(' <expression> ')'\n                | <string literal>\n   <binary op> ::= '+' | '-' | '*' | '/' | '%' | '==' | '!=' |\n                  '>' | '>=' | '<' | '<=' | 'in' | 'and' | 'or'\n                | <unary op> ::= '-' | 'not'",
      "type": "string"
    },
    "workspace_id": {
      "description": "The ID of the workspace if applicable",
      "type": "string"
    }
  },
  "required": [
    "event",
    "from_date",
    "to_date",
    "on"
  ],
  "type": "object"
}