Write a query using window functions to calculate the running total of revenue generated by each client segment over the last fiscal year at Intuit Management Consultancy.
Assume the last fiscal year is identified by fiscal_year = 2025. Include only transactions associated with a known client and sort each segment chronologically, using transaction_id to break date ties.
segment_name, transaction_date, transaction_id, revenue, and running_total.segment_name, transaction_date, and transaction_id.| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique revenue transaction identifier |
| client_id | INT | Client associated with the transaction |
| transaction_date | DATE | Date on which the revenue was recorded |
| fiscal_year | INT | Fiscal year of the transaction |
| revenue | NUMERIC(12,2) | Revenue amount for the transaction |
| Column | Type | Description |
|---|---|---|
| client_idPK | INT | Unique client identifier |
| client_name | VARCHAR(100) | Client display name |
| segment_name | VARCHAR(50) | Client segment used for reporting |