I have a table that stores stream data from the website. Within this, all records that start and end with a particular set of combinations of columns are considered a session. However, it is not flagged at all.
In this attached picture, I'm trying to generate the "New Column". So basically if the row has Click, Landing Page, Main Page that's the start of a session and if the row has Time Out, Landing Page that's the end of the session.
Is it possible to generate this in SQL? Any ideas or pointers are much appreciated. Thanks!!
Edit: I'm not having much luck with SQL. My last resort is to attempt with Python. Any experts in Python to help?
from How to generate a identifier for set of rows using SQL?
No comments:
Post a Comment