I have clickstream data in Azure Monitor Logs in this format:
Timestamp Category Session_ID Step_Name
10/22/2019, 9:28:14.868 AM A ++9Ti step 1
10/22/2019, 9:28:18.034 AM A ++9Ti step 2
10/22/2019, 9:28:22.487 AM A ++9Ti step 3
10/23/2019, 7:02:02.527 AM B ++MoY step 1
10/23/2019, 7:02:09.244 AM B ++MoY step 2
10/23/2019, 7:02:21.156 AM B ++MoY step 3 <--
10/23/2019, 7:02:27.195 AM B ++MoY step 3 <--
10/23/2019, 7:15:13.544 AM A ++0a3 step 1
10/23/2019, 7:15:35.438 AM A ++0a3 step 2
I need to get the mean time that a consumer spends on each step in a Category
Also, when steps are repeated (like step 3 in session_ID = '++MoY'), we need to take the latest timestamp while calculating the mean.
Example : Mean time spent on step 2 in category A is (3.166 + 21.894)/2 = 12.53 seconds. (Note : timestamp gives time at which step is completed)