Walk me through your analysis of this dataset.
Use the provided policyholder, claim, and payment data. Produce a regional claims summary that includes payment totals, closure timing, and records requiring data-quality review.
Output
- One row per region, including
Unknown for claims without a usable region.
- Return
region, claim_count, total_incurred, total_paid, average_days_to_close, and review_claim_count.
- Include all claims, sort by
claim_count descending, then region ascending.
Output details
- Sum each claim’s payment records once, and treat claims without payments as contributing
0 to total_paid.
- Treat missing
incurred_amount values as zero in total_incurred, including when all regional values are missing.
- Calculate
average_days_to_close from non-NULL closed_date values, retain negative durations, return NULL when none qualify, and round to two decimals.
- Count a claim for review when
incurred_amount is NULL, payments exceed incurred_amount, or closed_date precedes opened_date.