Skip to content
Advertisement

Calculate Time spent by users on the platform

I’m trying to calculate the time spent by users on my platform on a weekly basis. I have the following api_request_logs table (*Note: each row is duplicate)

I tried this query, however, it doesn’t seems it is outputting correct calculation .

Current output:

Desired output :

What I’m doing wrong or do you have a better idea to do it? Thanks

Advertisement

Answer

I think you just want to group by your url as well … try the following 🙂

#standardsql :

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement