Ameriprise needs transaction-level activity metrics for clients using its financial data platforms. Write a PostgreSQL query that calculates each client's rolling transaction total across the thirty-day period ending on every transaction date.
Unknown when a transaction has no matching client.amount for each client, partitioned by client_id and ordered by transaction_date.| Column | Type | Description |
|---|---|---|
| client_idPK | INTEGER | Unique Ameriprise client identifier |
| client_name | VARCHAR(100) | Client display name |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INTEGER | Unique transaction identifier |
| client_id | INTEGER | Client associated with the transaction |
| transaction_date | DATE | Transaction posting date |
| amount | NUMERIC(12,2) | Transaction amount, including reversals |