Average Balance
The Average Balance report.
For the selected accounts, the average, maximum and minimum balance in each period, and the money that came in, went
out and the net change. Use it to see how much of a period an account's money was actually there, for interest or fees
charged on a daily balance. With Display/Show table it also gives the figures as a table; the chart plots the
averages. In GnuCash: Reports ▸ Examples ▸ Average Balance.
The options that matter are Accounts/Accounts, General/Start Date and End Date, and General/Step Size. The
default General/Price Source is weighted-average.
Examples
Example: with a copy of the reports/average-balance example book open as book.gnucash, at 2024-03-15T12:00:00Z.
JSON-RPC
Request:
{"jsonrpc":"2.0","id":1,"method":"report.run","params":{"report":"Average Balance","options":{"Accounts":{"Accounts":["a0000000000000000000000000000002","a0000000000000000000000000000003"]},"General":{"Start Date":{"absolute":"1979-01-01"},"End Date":{"absolute":"1979-06-30"}},"Display":{"Show table":true}}}}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"title": "Average Balance",
"sections": [
{
"blocks": [
"…",
{
"kind": "table",
"rows": [
"…",
{
"role": "data",
"cells": [
{
"display": "02/01/79",
"…": "…"
},
{
"display": "02/28/79",
"…": "…"
},
{
"display": "$50.00",
"…": "…"
},
{
"display": "$100.00",
"…": "…"
},
"…"
],
"…": "…"
},
"…"
],
"…": "…"
},
"…"
],
"…": "…"
},
"…"
],
"…": "…"
}
}
Command line
red-ale exec --book book.gnucash report.run '{"report":"Average Balance","options":{"Accounts":{"Accounts":["a0000000000000000000000000000002","a0000000000000000000000000000003"]},"General":{"Start Date":{"absolute":"1979-01-01"},"End Date":{"absolute":"1979-06-30"}},"Display":{"Show table":true}}}'
It prints:
{
"title": "Average Balance",
"sections": [
{
"blocks": [
"…",
{
"kind": "table",
"rows": [
"…",
{
"role": "data",
"cells": [
{
"display": "02/01/79",
"…": "…"
},
{
"display": "02/28/79",
"…": "…"
},
{
"display": "$50.00",
"…": "…"
},
{
"display": "$100.00",
"…": "…"
},
"…"
],
"…": "…"
},
"…"
],
"…": "…"
},
"…"
],
"…": "…"
},
"…"
],
"…": "…"
}
MCP tool call
Tool call:
{"name":"report.run","arguments":{"report":"Average Balance","options":{"Accounts":{"Accounts":["a0000000000000000000000000000002","a0000000000000000000000000000003"]},"General":{"Start Date":{"absolute":"1979-01-01"},"End Date":{"absolute":"1979-06-30"}},"Display":{"Show table":true}}}}
Result:
{
"structuredContent": {
"title": "Average Balance",
"sections": [
{
"blocks": [
"…",
{
"kind": "table",
"rows": [
"…",
{
"role": "data",
"cells": [
{
"display": "02/01/79",
"…": "…"
},
{
"display": "02/28/79",
"…": "…"
},
{
"display": "$50.00",
"…": "…"
},
{
"display": "$100.00",
"…": "…"
},
"…"
],
"…": "…"
},
"…"
],
"…": "…"
},
"…"
],
"…": "…"
},
"…"
],
"…": "…"
}
}
Template GUID: d5adcc61c62e4b8684dd8907448d7900 · Script: example/average-balance.rhai
Options
Accounts
- Include Sub-Accounts (boolean, default
true): Include sub-accounts of all selected accounts. - Exclude transactions between selected accounts (boolean, default
false): Exclude transactions that only involve two accounts, both of which are selected below. This only affects the profit and loss columns of the table. - Accounts (accountList, default
[]): Do transaction report on this account.
Display
- Show table (boolean, default
false): Display a table of the selected data. - Show plot (boolean, default
true): Display a graph of the selected data. - Plot Type (list, default
["AvgBalPlot"]): The type of graph to generate. - Plot Width (plotSize, default
{"percent":100}): Width of plot, 10 - 100 in percent, above in pixels. - Plot Height (plotSize, default
{"percent":100}): Height of plot, 10 - 100 in percent, above in pixels.
General
- Report name (string, default
"Average Balance"): Enter a descriptive name for this report. - Stylesheet (multichoice, default
"Default"): Select a stylesheet for the report. - Add options summary (multichoice, default
"never"): Add summary of options. - Start Date (date, default
{"relative":"start-accounting-period"}): Start of reporting period. - End Date (date, default
{"relative":"end-accounting-period"}): End of reporting period. - Step Size (multichoice, default
"MonthDelta"): The amount of time between data points. - Report's currency (currency, default
"CURRENCY::USD"): Select the currency to display the values of this report in. - Price Source (multichoice, default
"weighted-average"): The source of price information.