I want to filter the events by distinct ids, i mean an id has multiple events but i want to filter the events by count and show only the highest count of the distinct id
Hi theunnamed, 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 events by distinct IDs and show only the distinct ID(s) with the highest event count, you can use Mixpanel's JQL (JavaScript Query Language). The JQL function groupBy() can be used to group events by distinct_id and count them, and then you can use sortDesc() to sort by count and select the top result.Here’s an example JQL query that does exactly this: LBKSfunction main() { return Events({ from_date: "2024-01-01", to_date: "2024-01-31" }) .groupBy(["distinct_id"], mixpanel.reducer.count()) .sortDesc("value") .slice(0, 1); // returns only the highest count distinct_id }LBKS- groupBy(["distinct_id"], mixpanel.reducer.count()) groups events by user and counts the number of events per user.
- sortDesc("value") sorts the results in descending order by event count.
- .slice(0, 1) (standard JavaScript) returns only the top result, i.e., the distinct_id with the highest event count.If you want the top N distinct IDs, you can use .reduce([mixpanel.reducer.top](http://mixpanel.reducer.top)(N)) instead: LBKSfunction main() { return Events({ from_date: "2024-01-01", to_date: "2024-01-31" }) .groupBy(["distinct_id"], mixpanel.reducer.count()) .reduce([mixpanel.reducer.top](http://mixpanel.reducer.top)(5)); // top 5 distinct_ids by event count }LBKSThis will return the top 5 distinct IDs with the highest event counts sortDesc(accessor) reducer.top(limit).Note: JQL is being deprecated by the end of 2025, so for long-term solutions, consider using Mixpanel’s Core Reports or exporting your data for analysis in another tool JQL deprecation notice.Let me know if you need a solution using another Mixpanel 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.
Where do i run this query? I am trying to view from mixpanel dashboard kapa.ai
Let me check the knowledge base for you again. One moment! 📚
You can run JQL queries directly from the Mixpanel dashboard by navigating to the JQL section in the Mixpanel web app. This is typically found under the "Reports" or "Apps" area, labeled as "JQL: Create custom queries using Javascript code." There, you can paste your JQL script and execute it to view the results.However, please note that JQL is currently in maintenance mode and will be deprecated after December 31, 2025. Mixpanel recommends using alternate methods for most use cases, such as Core Reports or the Export API, but as of now, the JQL editor is still available in the dashboard for running custom queries Docs / Reports / Apps / JQL.If you do not see the JQL option in your dashboard, it may have been disabled for your project or workspace. In that case, you can also run JQL queries via the API using tools like cURL or Python scripts Custom JQL Query.For step-by-step instructions: 1. Go to your Mixpanel project dashboard. 2. Find and open the JQL section (usually under "Reports" or "Apps"). 3. Paste your JQL script into the editor. 4. Run the query to view the results.If you need help finding the JQL section, refer to the Mixpanel JQL documentation.
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.
Show me the core reports usage kapa.ai for this request
Let me check the knowledge base for you again. One moment! 📚
To achieve your goal—filtering events by distinct IDs and showing only the distinct ID(s) with the highest event count—using Mixpanel’s Core Reports (specifically, the Insights report), you can follow these steps: 1. Create an Insights Report:
- Go to the Insights report in your Mixpanel dashboard.2. Select the Event:
- Choose the event you want to analyze (e.g., "Button Clicked" or "Page Viewed").3. Breakdown by Distinct ID:
- Add a Breakdown by the property distinct_id. This will show the count of events for each user.4. Sort by Event Count:
- In the results table, sort the breakdown by the event count in descending order. This will bring the distinct ID(s) with the highest event count to the top.5. View or Filter Top Results:
- You can manually view the top distinct ID(s) with the highest event counts. If you want to focus only on the top N, you can use the UI to limit the number of rows shown, but there is no built-in filter to show only the single highest count directly in the UI.Note: While you can easily see which distinct ID has the highest event count using breakdowns and sorting, Mixpanel’s Core Reports do not currently support filtering to show only the single top result automatically. You will need to visually inspect or export the data for further processing if you need more advanced filtering.For more details on using breakdowns and sorting in Insights, see the Insights Quick Start and Breakdowns documentation.If you need to automate this further, you would need to use JQL or export the data for processing outside Mixpanel.
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.
I couldnt find the insights link kapa.ai
Let me check the knowledge base for you again. One moment! 📚
If you are unable to find the "Insights" link or section in your Mixpanel dashboard, the knowledge sources do not provide detailed troubleshooting steps for this specific issue. However, according to the documentation, the Insights report is a core part of Mixpanel and is typically accessible from the main navigation or under the "Reports" section in the dashboard. It is possible that your project permissions, workspace configuration, or UI changes may affect its visibility Docs / Reports Overview.If you still cannot locate the Insights report, you may want to: - Check if you have the necessary permissions to access reports. - Look for a section labeled "Reports" or "Insights" in the main navigation. - Contact your Mixpanel admin or support for further assistance.I'm sorry, but the knowledge sources do not provide more specific guidance on what to do if the Insights link is missing.
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.
Breakdown shows only one id as it was filtered kapa.ai
Let me check the knowledge base for you again. One moment! 📚
If you apply a filter in Mixpanel’s Insights report to include only a single distinct_id, then the breakdown will only show that one ID, since the filter limits the data to events from that specific user. This is expected behavior: filters restrict the dataset before breakdowns are applied, so only the filtered distinct_id will appear in your breakdown results Docs / Reports Overview / Filters.If you want to see multiple distinct_ids in your breakdown, you should remove or broaden the filter so that more than one distinct_id is included in the dataset. Then, when you apply a breakdown by distinct_id, you will see counts for each included user.If you need to focus on the top N distinct_ids by event count, you can sort the breakdown results by count in descending order and manually review the top results, as Mixpanel’s Core Reports do not support automatically filtering to only the top N within the UI Docs / Reports / Insights: Visualize trends and compositions within your data / Quick Start.
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.
Can i add more columns to the insight report kapa.ai
