See us at ProductCon in SF on Oct. 8th! Check out #03_resources-and-events channel for more info.
How can I calculate the percentile 95 of specific measure? (I can find p90 and p99 and there’s no p95)?
Based on your previous JQL query and the context of our conversation, it seems you're trying to create a custom event to capture the 95th percentile of a specific measure (likely related to the "agent-video" event) in Mixpanel. Here's how you can approach creating a custom event for this purpose: 1. Custom Event Creation:
You should create a custom event that represents the 95th percentile of the measure you're interested in. For example, if you were measuring video duration, you might name your custom event something like "95th Percentile Agent Video Duration".To create this custom event: 1. Go to the Lexicon in your Mixpanel project.
2. Click on the "Custom Events" tab.
3. Click "Create Custom Event".
4. Name your event (e.g., "95th Percentile Agent Video Duration").
5. In the definition, you'll use your JQL query. It might look something like this: LBKSfunction main() { return Events({ event_selectors: [{event: "agent-video"}] }) .reduce(mixpanel.reducer.numeric_percentiles( "properties.duration_seconds", [95])); }LBKS
Replace "duration_seconds" with the actual property name you're measuring.Mixpanel Docs: Custom Events provides detailed instructions on how to create and manage custom events.Remember, custom events based on JQL queries are not calculated in real-time. Mixpanel typically updates these daily, so there may be a delay in seeing the most recent data.After creating this custom event, you'll be able to use it in your Insights reports and other Mixpanel charts. You can select it just like any other event when creating your reports.Keep in mind that this custom event will give you a single value (the 95th percentile) for your entire dataset. If you need to break this down by time or other properties, you might need to adjust your approach or consider using Mixpanel's Data Pipelines feature for more complex analyses.
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 use a custom measure created with JQL in Mixpanel charts, you'll need to follow a specific process. Unfortunately, there isn't a direct way to use JQL queries in standard Mixpanel charts. However, you can create a custom event or property based on your JQL query and then use that in your charts. Here's how you can approach this: 1. Create a Custom Event or Property: First, you need to create a custom event or property based on your JQL query. This is done using Mixpanel's Custom Events feature. Mixpanel Docs: Custom Events explains how to create custom events. You can use your JQL query as the basis for defining the custom event.2. Use the Custom Event in Charts: Once you've created a custom event or property, you can use it in your Insights reports and other Mixpanel charts just like any other event or property. Mixpanel Docs: Insights provides information on how to use events and properties in Insights reports.3. Limitations: It's important to note that this method has some limitations. Custom events are calculated periodically, not in real-time, and there may be some delay in data updates.4. Alternative: Data Pipelines: For more complex scenarios or real-time needs, Mixpanel recommends using their Data Pipelines feature to export your data to a data warehouse where you can perform custom calculations and then import the results back into Mixpanel. Mixpanel Blog: Data Pipelines mentions this feature as an alternative for running arbitrary queries on your Mixpanel events.Remember, JQL is primarily a tool for ad-hoc analysis and data exploration. For recurring reports and visualizations, it's generally better to use Mixpanel's built-in reporting features or create custom events/properties based on your JQL insights.If you need more specific guidance on implementing this for your particular use case, I'd recommend reaching out to Mixpanel's support team for personalized assistance.
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! 📚
Certainly! I understand you're asking about where to insert the JQL (JavaScript Query Language) code in Mixpanel. Here's where you can use this code: 1. JQL Interface: The primary place to insert and run JQL code is in Mixpanel's JQL interface. You can access this by: a. Log into your Mixpanel account b. Go to the "Apps" section in the left sidebar c. Click on "JQL" (JavaScript Query Language) Here, you'll find a code editor where you can paste your JQL script. Mixpanel Docs: JQL provides more information about accessing and using the JQL interface.2. API Endpoint: If you're using Mixpanel programmatically, you can send JQL queries to the JQL API endpoint. Here's an example using curl:
sh
curl [https://mixpanel.com/api/query/jql](https://mixpanel.com/api/query/jql) \
-u YOUR_API_SECRET: \
--data-urlencode script@my_query.js
```LBKSLBKS This method is described in the [Mixpanel Query API documentation](https://github.com/mixpanel/docs/blob/main/reference/Query%20API/jql/query-jql.md).LBKSRemember, JQL is a powerful tool for custom queries in Mixpanel, but it requires some familiarity with JavaScript and Mixpanel's data structure. If you're new to JQL, it might be easier to start with the web interface before moving to API calls.LBKSAlso, make sure you have the necessary permissions in your Mixpanel project to run JQL queries. If you're having trouble accessing JQL, you might need to check with your project administrator.
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])); }LBKS
In 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! 📚
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 }LBKS
The 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.