Hi, I want to calculate the avg. of sum of duration for user sessions, but the daily sum. For example, I want to see on the last 30 days what was the avg sum of daily session duration for each user. How can I do it?
Hi Moran S., 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 average daily sum of session duration per user, you can use the Aggregate Property per User measurement in the Insights report.Here are the steps to set this up: 1. Select the Event: In the Insights report, select the Session Start or Session End event [Session Controls in Reports]. 2. Select Measurement: Click on the measurement (default is usually "Total Events") and choose Aggregate Property per User [Measurements]. 3. Choose the Property: Select the Session Duration (Seconds) property. 4. Set the Aggregation: ** Set the internal calculation to Sum. This will calculate the total session duration for each user within the specified interval (e.g., daily) [Aggregate Property per User]. ** Set the secondary aggregation to Average. This will then average those sums across all users for each day [Measurements]. 5. Adjust Time and Units: ** Set the date range to Last 30 days in the date picker [Date Range]. ** Ensure the chart granularity is set to Day. 6. Optional - Convert to Minutes: Since the duration is tracked in seconds, you can use a Formula to divide the result by 60 to display the values in minutes [FAQ; Formulas].Why this works: In the Insights report, the "Aggregate Property per User" computation is done on a per-interval basis. For a line chart set to "Day," Mixpanel first sums the session duration for each user on that specific day and then calculates the average of those individual sums [Behavioral Properties].
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 see it in bars or metrics? and not on a timeline?
Let me check the knowledge base for you again. One moment! 📚
Yes, you can visualize this data in a Bar or Metric chart.In Mixpanel's Insights report, choosing a Bar, Metric, or Pie chart changes the time context from a "per-interval" (daily) view to a calculation across the entire date range selected in the date picker [Behavioral Properties; Charts].
How it behaves in these visualizations:
** Bar Chart: This will show the average of the total sum of session durations per user for the entire 30-day period. Instead of a daily trend, you will see a single bar representing the aggregate average for that timeframe [Charts]. ** Metric Chart: This will display a single, large number representing the average total session duration per user for the whole 30 days [Charts].
Important Note on "Daily" Context:
If you specifically need to see the average of daily sums aggregated into a single bar (i.e., the average of the 30 daily averages), these charts will not automatically perform that "average of averages" calculation. They will instead calculate the total sum per user across all 30 days and then average those totals across your user base [Behavioral Properties]. If you want the specific daily average reflected in a bar, you would keep the line chart but use the Table view below it to see the values, or use a Formula to further manipulate the aggregation [Sorting].
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.
Hi, yes of course. My question was specifically on the bars chart, which shows the daily avg. for the last 30 days
how?
Yes I understand, this is how I worked. The thing is it will calculate the avg. duration fpr all users for a day, and the customer wants to see "during the last 30 days, what was the daily avg time student spent for a course. BTW, are you also a partner of Mixpanel?
