Active users last x days
I have the following dataset ( see the attached screenshot). It shows the userID active on a given date and the session time. I want to determine which users were active in the current week, t-1 week, t-2 week etc. As an output I want a table with the following columns: UserID, active this week column ( 0 or 1 value), active last week (0 or 1 value) etc. How can I transform my current dataset in ETL or create calculated fields to create such an output. Any help would be greatly appreciated!