Given a table of historical sales transactions, write a query to find the top three salespeople by revenue in each region for the last consecutive quarters at ALT Sales.
Use the latest transaction quarter and the immediately preceding quarter. Include only salespeople with activity in both quarters, and rank them separately within each region and quarter.
Output
- One row per qualifying region, quarter, and salesperson.
- Columns:
region_name, quarter_start, salesperson_name, quarterly_revenue, and revenue_rank.
- Include the top three ranks per region and quarter, allowing ties, ordered by quarter, region, rank, and salesperson name.