Write a window function to calculate the running total of active subscribers over time, grouped by region, for Nyc Staffing.
Use valid activation and deactivation events for subscribers with a known region. The running count should reflect each region's cumulative net change through each event date.
region, event_date, and active_subscriber_countregion, then event_date ascending| Column | Type | Description |
|---|---|---|
| subscriber_idPK | INT | Unique subscriber identifier |
| subscriber_name | VARCHAR(100) | Subscriber display name |
| region | VARCHAR(50) | Subscriber region |
| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique status event identifier |
| subscriber_id | INT | Subscriber associated with the event |
| event_date | DATE | Date of the status change |
| event_type | VARCHAR(20) | Subscriber status change type |