kapa.ai i have event named Book a Visit Confirm Success now for a distinct user i want to know avg duration between two Book a Visit Confirm Success event for same user
To calculate the average duration between two "Book a Visit Confirm Success" events for the same user, you can use Mixpanel's Insights report with the Aggregate Property per User measurement. Here's how you can set this up: 1. In Insights, select your "Book a Visit Confirm Success" event.
2. For the measurement, choose "Aggregate Property per User" from the dropdown menu.
3. Select "Average" as the aggregation type.
4. For the property, you'll want to use the time between events. Mixpanel doesn't have a built-in property for this, so you may need to calculate and send this as a custom property with your events.If you haven't been tracking the time between events as a custom property, you unfortunately won't be able to calculate this directly in Mixpanel's UI. The knowledge sources provided don't contain information about calculating time between specific events for the same user.However, you might be able to approximate this using JQL (JavaScript Query Language) in Mixpanel. Here's a general approach, though the exact implementation would depend on your specific data structure: 1. Use the Events()
function to query for your "Book a Visit Confirm Success" events.
2. Group these events by user.
3. For each user, calculate the time difference between consecutive events.
4. Average these time differences.Unfortunately, I can't provide a specific JQL code snippet as the knowledge sources don't include an exact example for this scenario. For more information on using JQL and its built-in functions, you can refer to the JQL Builtins documentation.If you need to calculate this metric regularly, consider adding a custom property to your events that tracks the time since the last "Book a Visit Confirm Success" event for each user. This would make it much easier to calculate in Mixpanel's UI using the Aggregate Property per User measurement.
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.