Skip to content

Monthly

Compare last month's P&L with the month before

On the 1st you get profit and loss for the previous two months side by side.

Runs
Monthly
Apps
Xero
AI
Not needed
Access
accounting.reports.read

Send this to your assistant

Create a ClickRuntime automation: on the 1st of each month, email me Xero's profit and loss for last month next to the month before.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

Many small business owners see their profit and loss only when the accountant sends a quarterly summary, by which time a costly trend is three months old. A subscription creeping up, a drop in gross margin after a supplier price change, a seasonal dip that should have been planned for: all invisible until someone runs the report in Xero and reads it carefully.

On the first of each month, the automation calls Xero's Profit and Loss report with two periods, last month and the one before, formats the figures and emails them to you. Having two periods side by side means the report shows direction as well as the current result.

Owners who want a short monthly habit before a bookkeeper meeting, and managers reporting to a partner or board, find it fits their routine.

What you get out of it

  • Margin changes are seen within weeks

    If cost of sales jumped five points after a supplier increase, the two-period layout shows it in the month it happened instead of at quarter end. Early correction is far cheaper than finding out after three months of lower margins.

  • Two periods give direction

    A single month tells you where you are. Last month beside the one before tells you whether you are improving, which is the question owners really ask. Direction of travel is what most owners really want from a financial report.

  • No logging in to run reports

    The figures arrive by email at the start of the month, so reviewing profit does not depend on remembering to open Xero and click through the reporting menu. That small saving of effort is often the difference between a report read and a report skipped.

  • Better bookkeeper meetings

    Arriving at a monthly catch-up having already read the numbers means the conversation is about decisions, not about reading out what the report says. Your accountant also gets a more engaged client who comes prepared with questions.

  • A dated trail of results

    A folder of monthly emails becomes a simple history you can scan when preparing a loan application, a budget or a conversation with an investor. It is a handy reference when a lender or buyer asks how the business has traded.

How it works

What happens, step by step

  1. On the 1st of each month ClickRuntime runs Xero's profit and loss report for the last two months.

  2. It lays the two months side by side, line by line, from income through to net profit.

  3. The comparison table arrives in your inbox.

Before it runs live

  • Connect Xero

What you get

RunsMonthly
Compare last month's P&L with the month beforetoday, 9:00Succeeded
Email · Monthly P&LTotal Income | 84,200.00 | 79,650.00 Net Profit | 18,430.00 | 15,980.00

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Run it at a different time, more or less often, or only on weekdays
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Xero steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
monthly_p_and_l_report.pyexample
from datetime import date, timedelta
from clickruntime import on_trigger, credentials, http, notify

API = "https://api.xero.com/api.xro/2.0"

def xero_headers():
    token = credentials.connection("xero", "work")
    tenant = http.get("https://api.xero.com/connections", headers={"Authorization": f"Bearer {token}"}).json()[0]["tenantId"]
    return {"Authorization": f"Bearer {token}", "xero-tenant-id": tenant, "Accept": "application/json"}

@on_trigger
def run(event):
    end = date.today().replace(day=1) - timedelta(days=1)
    params = {"fromDate": end.replace(day=1).isoformat(), "toDate": end.isoformat(), "periods": 1, "timeframe": "MONTH"}
    report = http.get(f"{API}/Reports/ProfitAndLoss", headers=xero_headers(), params=params).json()["Reports"][0]
    lines = [" | ".join(c["Value"] for c in report["Rows"][0]["Cells"])]
    for section in report["Rows"][1:]:
        for row in section.get("Rows", []):
            if row["RowType"] == "SummaryRow" or not section.get("Title"):
                lines.append(" | ".join(c["Value"] for c in row["Cells"]))
    notify.email_me(f"Profit and loss: {end:%B %Y}", "\n".join(lines))
    return {"rows": len(lines)}

FAQ

Common questions

Is this report based on cash or accrual accounting?
It follows the basis Xero uses for the report, which is accrual by default, though the report can be run on a cash basis. If your accountant works on cash, tell your AI assistant so the same basis is used each month.
Will unreconciled transactions affect the numbers?
Yes. The profit and loss only reflects what has been recorded in Xero. If bank lines are still unreconciled or bills not yet entered, the report may understate costs, so many people pair it with a reconciliation reminder.
Can the report cover a longer period like year to date?
Yes. The periods and timeframe are parameters of the Xero report call, so you can ask for year to date, the last quarter or twelve monthly columns. Your AI assistant will show the change before it takes effect.
What permissions does it need?
accounting.reports.read. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (monthly). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Compare last month's P&L with the month before” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.