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.
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
On the 1st of each month ClickRuntime runs Xero's profit and loss report for the last two months.
It lays the two months side by side, line by line, from income through to net profit.
The comparison table arrives in your inbox.
Before it runs live
- Connect Xero
What you get
Build your own
Need it to work differently?
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
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?
Will unreconciled transactions affect the numbers?
Can the report cover a longer period like year to date?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Get overdue invoices in Slack by age
Each morning Slack lists invoices overdue by 7, 14 and 30 days, without repeating ones already flagged at that stage.
See how it worksSee the week's payments every Friday
A Friday email lists the payments Xero recorded this week and their total.
See how it worksGet a Monday list of bills falling due
You start the week knowing which supplier bills need paying in the next seven days.
See how it worksKeep exploring
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.