analyze_journal_variance
Compare two periods of journal entries (QBO or Xero) and flag accounts where net movement deviates materially between periods, with optional period labels for clarity.
Instructions
Compare two periods of journal-entry data (QBO or Xero — source auto-detected from headers) and flag accounts whose movement deviates materially between periods. Aggregates lines per account into a net total for each period, then surfaces accounts where the period-over-period change crosses a materiality threshold (≥5% relative AND ≥$100 absolute; severity high at ≥50%, medium at ≥20%, low at ≥5%). Inputs are two CSV exports — periodACsv (earlier period) and periodBCsv (later period). Optional periodALabel / periodBLabel for human-readable flag messages (e.g. "Q1 FY2024" vs "Q2 FY2024"). Max 5,000 rows per period; max 5 MB each. Use this when a user pastes two periods and asks "what changed?", "show me variances", "what jumped period-over-period". Returns a flag list ordered by largest delta, a roll-up, and a shareable URL. Both periods must be the same source — mixing QBO + Xero in one call returns an error.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| periodACsv | Yes | Raw CSV text of the EARLIER period's journal-entry export (QBO Journal Entries or Xero Manual Journals). Source is auto-detected from the headers. | |
| periodBCsv | Yes | Raw CSV text of the LATER period's journal-entry export. Source is auto-detected from the headers (must match periodACsv). | |
| periodALabel | No | Optional human label for the earlier period — e.g. "Q1 FY2024". Used in flag messages. | |
| periodBLabel | No | Optional human label for the later period — e.g. "Q2 FY2024". |