How can I calculate the percentile 95 of specific measure? (I can find p90 and p99 and there’s no p95)?
Hi Yulia M., 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 calculate the 95th percentile of a specific measure in Mixpanel, you have a couple of options: 1. In Insights reports: Mixpanel's Insights report allows you to calculate percentiles, including the 95th percentile. When using the "Aggregate Property" or "Aggregate Property per User" measurements, you can select the "Percentiles" aggregation option. However, the default options only include 25th, 75th, 90th, and 99th percentiles. The 95th percentile is not directly available in this UI. Mixpanel Docs: Insights Measurements mentions these percentile options but doesn't include the 95th percentile.2. Using JQL (JavaScript Query Language): If you need the exact 95th percentile, you can use Mixpanel's JQL to calculate it. JQL provides more flexibility in specifying custom percentiles. Here's an example of how you can calculate the 95th percentile using JQL:
return Events({
from_date: "2023-01-01",
to_date: "2023-12-31",
event_selectors: [{event: "your_event_name"}],
})
.reduce(mixpanel.reducer.numeric_percentiles(
"properties.your_property_name", [95]));
}
```LBKSLBKS This code will return the 95th percentile for the specified property of your chosen event.LBKS [Mixpanel Docs: JQL Builtins](https://docs.mixpanel.com/docs/reports/apps/jql#mixpanelreducernumeric_percentilesaccessor-percentiles-spec) shows how to use the `numeric_percentiles` reducer to calculate custom percentiles.LBKSRemember to replace "your_event_name" and "your_property_name" with the actual event and property you want to analyze, and adjust the date range as needed.LBKSUsing JQL gives you the flexibility to calculate any specific percentile you need, including the 95th percentile, which is not directly available in the standard Insights UI.
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 answer your question about setting default dates to the minimum and maximum dates in Mixpanel, I'll need to provide some context and clarification.Mixpanel doesn't have a built-in feature to automatically set the date range to the absolute minimum and maximum dates of your data by default. However, there are some options you can consider: 1. Date Range Selector: Mixpanel provides a date range selector that allows you to choose from preset options or select a custom date range. The default is usually set to "Last 30 days" in most reports. Mixpanel Docs: Date Range explains the various preset options and how to select custom date ranges.2. Custom Date Range: You can manually set a very wide date range to encompass all your data. For example, you could set the start date to a time before you started collecting data and the end date to today or a future date.3. JQL Queries: If you're using JQL (JavaScript Query Language) for custom queries, you have more flexibility. You could potentially write a query that first determines the min and max dates in your data and then uses those for the main query. However, this would be a custom solution and not a default setting.4. API or Data Export: If you're accessing data via Mixpanel's API or exporting data, you might be able to determine the full date range of your data and use that information in your queries or analysis.It's important to note that Mixpanel doesn't provide a direct way to automatically set the default date range to the absolute min and max dates of your entire dataset across all reports. The date range typically needs to be set manually or programmatically for each query or report.If you need this functionality consistently, you might want to consider creating a custom solution using Mixpanel's API or JQL, or reaching out to Mixpanel's support team to suggest this feature for future updates.
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! 📚
I apologize, but I need more context to understand your issue fully. It seems you're encountering an error message related to the main function in a JQL (JavaScript Query Language) query for Mixpanel. The error "main is unexpected variable" suggests there might be a syntax error in your JQL code.To help you resolve this, let's review the correct structure for a JQL query in Mixpanel: LBKSfunction main() { // Your query code goes here return Events({ // Event parameters }) // Additional transformations and reducers }LBKSThe main() function is crucial in JQL queries. As stated in the Mixpanel JQL documentation: "The JQL JavaScript code must define a main() function. This JavaScript will be compiled, and the main() function will be executed by the query engine."Here are a few things to check: 1. Make sure you've defined the main function correctly.
2. Ensure that your function is named main (all lowercase).
3. Check that you haven't accidentally used main as a variable name elsewhere in your code.
4. Verify that your JQL query is properly formatted and all parentheses, brackets, and braces are correctly matched.If you're still encountering issues, it would be helpful if you could provide the exact JQL code you're trying to run. This would allow me to identify the specific problem and provide a more targeted solution.Remember, JQL is a powerful tool in Mixpanel, but it requires careful syntax. If you're new to JQL, you might want to start with some of the examples provided in the Mixpanel documentation and gradually build up to more complex queries.
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! 📚
I understand you're having trouble with the JQL code you've provided. Let's take a closer look at the issue and make some adjustments to help it work correctly.The structure of your code is correct, but there's one key element that needs to be changed. In the numeric_percentiles reducer, you're using a placeholder property name instead of an actual property from your event data. Here's how we can fix it: 1. Replace "properties.your_property_name" with the actual property name you want to analyze. This should be a numeric property associated with your "agent-video" event.Here's an example of how your corrected code might look: LBKSfunction main() { return Events({ from_date: "2023-01-01", to_date: "2023-12-31", event_selectors: [{event: "agent-video"}], }) .reduce(mixpanel.reducer.numeric_percentiles( "properties.duration_seconds", [95])); }LBKSIn this example, I've replaced "properties.your_property_name" with "properties.duration_seconds", assuming you want to calculate the 95th percentile of the video duration. You should replace "duration_seconds" with the actual name of the numeric property you want to analyze.Some things to keep in mind: 1. Make sure the property you're using exists in your "agent-video" event and contains numeric values.
2. Double-check that "agent-video" is the correct event name in your Mixpanel project.
3. Verify that you have data for this event within the specified date range (January 1, 2023 to December 31, 2023).If you're still encountering issues after making these changes, it would be helpful to know the specific error message you're receiving. Also, you might want to use the Mixpanel JQL Debugger to help identify any problems with your query.Remember, JQL is case-sensitive, so make sure your event names and property names match exactly with what's in your Mixpanel project.Mixpanel Docs: JQL Builtins provides more examples and details on using the numeric_percentiles reducer if you need further reference.
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! 📚
