I have a file of millions of transactions that goes back many years. At the end of each month, I'd like to get a unique list of users that used the product within the last 90 days. I'm doing this very manually right now by entering all of the conditions into a formula, but it feels very inefficient, and if the dataset was smaller it would be much easier to do in SQL.
| transaction_ts | user_id |
| 2024-01-01 00:04:34 | 123456 |
| 2024-01-11 00:04:34 | 987654 |
| 2024-02-03 00:04:34 | 666666 |
| 2024-02-07 00:04:34 | 123456 |
| 2024-03-01 00:04:34 | 777777 |
| 2024-04-01 00:04:34 | 666666 |
| 2024-04-12 00:04:34 | 123456 |
| 2024-05-01 00:04:34 | 987654 |
| 2024-06-01 00:04:34 | 777777 |
| 2024-06-16 00:04:34 | 777777 |
| 2024-07-03 00:04:34 | 123456 |
| 2024-08-07 00:04:34 | 987654 |
| 2024-09-04 00:04:34 | 444444 |
| 2024-09-11 00:04:34 | 777777 |
| 2024-10-02 00:04:34 | 777777 |
| 2024-10-15 00:04:34 | 987654 |
I would like to get the result that looks like the following without having to manual
| Start Date | End Date | Unique User Count |
| 12/31/2023 | 3/31/2024 | 4 |
| 1/30/2022 | 4/30/2024 | 3 |
| 3/2/2022 | 5/31/2024 | 3 |
| 4/1/2022 | 6/30/2024 | 4 |
| 5/2/2022 | 7/31/2024 | 2 |
| 6/2/2022 | 8/31/2024 | 3 |
| 7/2/2022 | 9/30/2024 | 4 |
| 8/2/2022 | 10/31/2024 | 3 |