How do I filter the query segmentation report by multiple properties? https://developer.mixpanel.com/reference/segmentation-query
Hi Lois, Please stand by as I search the Mixpanel knowledge base for an AI-powered answer. I normally take about 15 seconds or so. In case AI cannot answer your question, feel free to reach out to Mixpanel support at mixpanel.com/get-support. If you have follow-up questions for this thread, please tag me again with your question: @kapa.ai <follow-up question> 👋
Feel free to ask a follow-up question once I've answered by mentioning me with @kapa.ai
To filter a Mixpanel segmentation query report by multiple properties, you should use the where parameter in the API request. The where parameter accepts a segmentation expression, which can combine multiple property filters using logical operators like and and or.For example, to filter events where country is "US" and device is "Android", your where expression would look like: LBKSproperties["country"] == "US" and properties["device"] == "Android"LBKS
You would include this in your API request as the value for the where query parameter. The segmentation expressions support combining multiple conditions, as described in the segmentation expressions grammar: LBKS<expression> ::= 'properties["' <property> '"]' | <expression> <binary op> <expression> ... <binary op> ::= ... | 'and' | 'or'LBKS
So, your GET request might look like: LBKSGET /segmentation?event=EventName&from_date=2023-01-01&to_date=2023-01-31&where=properties["country"]=="US"%20and%20properties["device"]=="Android"LBKS
This will return data for the specified event, filtered by both properties.For more details on segmentation expressions and the where parameter, see the documentation on Segmentation Expressions and the Segmentation Query API.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
Let me check the knowledge base for you again. One moment! 📚
To return a single total count of users with an event over the course of a week (instead of one value per day), you need to adjust the unit parameter in your query to week. This will aggregate the results by week, giving you one value per week rather than per day.For example, in the Query API, you would set: LBKSunit=weekLBKS
This way, the API will return a single value for the entire week specified by your from_date and to_date.If you want a single total for a custom date range (not necessarily aligned to a calendar week), you may need to sum the daily values yourself, as the API is designed to bucket results by the specified unit (day, week, month, etc.) and does not natively provide a "total for arbitrary date range" in a single value. So, set unit=week to get one value per week, or sum the results manually if you need a total for a custom range Query API - Event Breakdown.If you are using the Mixpanel UI, you can also select "week" as the interval in the report builder to aggregate by week instead of by day Docs / Reports / Insights.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
How do I break my query down by two different event property values?
Let me check the knowledge base for you again. One moment! 📚
I'm sorry, but the knowledge sources do not explicitly mention support for breaking down a query by two different event property values simultaneously. The documentation describes how to break down results by a single property or cohort using the Breakdown feature, but it does not state whether multiple breakdowns (i.e., by two event properties at once) are supported in a single query. You can break down by one property or cohort at a time in the UI or API, but combining two event property breakdowns is not clearly documented in the provided sources Docs / Reports Advanced Filter & Breakdown Usage.If you need to break down by two properties, you may need to create a new property that combines the values of the two properties before sending the data to Mixpanel, or check the latest Mixpanel documentation for updates on this feature.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.