Use LAG() window function for period-over-period comparison
Show me monthly encounter volume with month-over-month change as a percentage. I want to see if we're trending up or down. Also — exclude encounters from the provider with the future hire date. That data is suspect and I don't want it in the trend.
Each hint you reveal reduces the XP you can earn. Try the query first.
Aggregate monthly counts first. Then a window function that looks one row back chronologically gives you the prior month's count
Exclude the suspect provider with the future hire_date before aggregating, then compute MoM % from the current and lagged counts
`LAG(encounter_count, ___) OVER (ORDER BY ___, ___) AS prior_count` — then `ROUND(100.0 * (encounter_count - prior_count) / ___, 1) AS mom_change_pct`