how do i get all the events where screen height > screen width?
You can filter events where $screen_height > $screen_width using a few different approaches in Mixpanel:
In-App Reports (Filters)
In any Mixpanel report, you can add an inline or global filter using the Filter button and select the $screen_height property with a > operator compared to $screen_width. [Filters]
Both $screen_height and $screen_width are default properties automatically collected by Mixpanel's client-side SDKs. [Default Properties]
Using JQL (Custom Query)
โ ๏ธ Note: JQL is currently in maintenance mode. Mixpanel recommends using alternative methods such as the Export API or in-app reports instead. [JQL Docs]
If you still want to use JQL, here's how you'd write the query:
function main() {
return Events({
from_date: "2024-01-01",
to_date: "2024-01-31"
})
.filter(function(event) {
return event.properties.$screen_height > event.properties.$screen_width;
});
}This uses the .filter() transformation to keep only events where $screen_height is greater than $screen_width. [JQL Transformations]
Using the Segmentation API
You can also use the Query API's segmentation endpoint with a where expression filter. Based on the segmentation expression reference, comparison operators like > work on numeric properties, so you could pass a where clause such as:
properties["$screen_height"] > properties["$screen_width"]The knowledge sources do not explicitly show the full segmentation API where parameter syntax for comparing two properties against each other, so I'd recommend testing this or reaching out to Mixpanel support if you run into issues with that approach.
โน๏ธย Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
if i do insights --> all events --> then filter using Screen Height 'greater than' im only allowed to enter a number i cant filter using two properties? like: screen height < screen width? kapa.ai
You're correct โ in the Mixpanel Insights UI, when you add a filter on a property like "Screen Height," you can only compare it against a static value (a number you type in). The UI does not support comparing one property directly against another property (e.g., Screen Height > Screen Width) as a filter condition.
To achieve a property-vs-property comparison, your best options are:
1. Custom Property
You can create a Custom Property using an if/else formula to derive a new boolean-like property on the fly, such as:
if(number(properties["$screen_height"]) > number(properties["$screen_width"]), "portrait", "landscape")You could then filter or break down by this custom property in Insights. [Custom Properties]
2. Query API with a where expression
Using the Segmentation Query API, you can pass a where parameter that compares two properties directly:
properties["$screen_height"] > properties["$screen_width"]The segmentation expression grammar supports binary comparison operators between expressions, which includes property references. [Segmentation Expressions]
3. Export API + external analysis
Export the raw events and filter them externally using your own tooling.
The knowledge sources do not explicitly confirm whether the Custom Property formula approach fully supports cross-property numeric comparisons in all cases, so I'd recommend testing it in the UI or reaching out to Mixpanel support if you run into issues.
โน๏ธย Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
does this custom property apply to all events if i use the 'All Events' event? kapa.ai
Based on the knowledge sources available, I can share what's documented about custom properties, but I cannot fully confirm the specific behavior you're asking about.
What the docs do say is:
Custom properties are created within a report and can be used almost anywhere that regular properties can be used (filters, breakdowns, etc.). [Custom Properties]
When you create a "Custom Event Property", both event and user profile properties are available to use in the formula. [Custom Properties]
However, the knowledge sources do not explicitly describe how a custom property behaves when applied to the "All Events" selector โ specifically whether the formula would evaluate correctly across all event types, or only for events that actually contain the $screen_height and $screen_width properties.
In practice, events that don't have those properties would likely return null/undefined values in the formula, which could affect filtering behavior. I'd recommend:
Testing it in the UI โ create the custom property and apply it as a filter under "All Events" to see if it returns the expected results.
Reaching out to Mixpanel Support for a definitive answer on this edge case.
โน๏ธย Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
so this custom property, i cant toggle for it to display in the events section of Lexicon? kapa.ai
Based on the knowledge sources, custom properties created locally within a report are private to you by default and can be saved/shared with others. [Custom Properties]
Regarding Lexicon specifically, the docs mention that Lexicon contains a "Custom Events" tab and sections for Cohorts, Lookup Tables, Formulas, and Behaviors under "Computed Data" โ but custom properties are not listed as having their own dedicated tab in Lexicon. [Lexicon Overview]
So the knowledge sources do not explicitly confirm that saved custom properties appear as a manageable/toggleable item in the Lexicon the same way events and event properties do. The docs only mention that you can view and manage Custom Events, Formulas, and Behaviors from Lexicon โ not custom properties directly.
I'd recommend checking your Lexicon UI to see if saved custom properties appear there, or reaching out to Mixpanel Support for a definitive answer.
โน๏ธย Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
so this custom property, i cant toggle for it to display in the events section of Data? Like the other properties: OS, DPI, etc? kapa.ai
Based on the knowledge sources available, I cannot confirm that custom properties can be toggled to display in the Events/Properties section of Lexicon (Data Management) the same way default properties like $os or $screen_dpi do.
What the docs do clarify:
Default properties (like $os, $screen_dpi, etc.) are automatically collected by Mixpanel's SDKs and appear natively in Lexicon under Event Properties. [Default Properties]
Lexicon manages tracked data (Events, Event Properties, Profile Properties) and computed data (Cohorts, Custom Events, Lookup Tables, Formulas, Behaviors) โ but custom properties are not listed as a category in Lexicon. [Lexicon Overview]
Custom properties are created on the fly within reports and can be saved/shared, but they are a report-level construct rather than a tracked data construct. [Custom Properties]
So based on the available documentation, custom properties do not appear to be manageable in Lexicon the same way native event properties are. For a definitive answer, I'd recommend reaching out to Mixpanel Support.
โน๏ธย Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
