Given a dataset, how would you analyze it or solve the problem?
Use the provided relational dataset to produce a concise monthly analysis for January through March 2025. Include qualifying accepted records with matching event details, while retaining entities and months with no qualifying activity.
Output
- One row per entity and calendar month.
- Columns:
entity_name, segment, month, accepted_records, total_amount, prior_month_total, pct_change, and segment_rank.
- Include all entities for all three months, calculate percentage change only when the prior total is positive, rank entities within each segment and month by total amount descending, and order by
segment, month, segment_rank, and entity_name.
Output details
- Include only records with matching event details.
- Treat January 1, 2025 as inclusive and April 1, 2025 as exclusive.
- Treat missing activity and
NULL amounts as zero, while counting qualifying records regardless of amount.
- Set
prior_month_total to NULL for each entity's first month.
- Round
pct_change to two decimal places and return NULL when the prior total is not positive.
- Use competition ranking so tied totals share a rank and subsequent ranks skip accordingly.