compare_periods
Compare a health metric across two date periods, returning each aggregate with change and percent change. Build periods before and after an event to analyze its impact.
Instructions
Compare a metric between two arbitrary date periods (A vs B): each aggregate plus the change and percent change. Pass periodA/periodB explicitly, or pass anchor {eventId, days} to build both periods around a logged event (the before/after question, with the event day excluded from both sides).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| anchor | No | Build both periods around a logged event instead of passing dates: periodA is the {days} days before the event date, periodB the {days} days after, the event day itself excluded from both. Get event ids from list_events. Pass either anchor or periodA/periodB, not both. | |
| metric | Yes | ||
| periodA | No | ||
| periodB | No | ||
| excludeTravelDays | No | Drop days on which a timezone change landed (health-days.json): those days were not 24 hours long, so their totals are stretched or shortened by the clock. The answer reports how many days were excluded and why. |