Report

Income vs. Day of Week

Shows a piechart with the total income for each day of the week

A pie chart of income between two dates by the weekday it arrived on. See [Expenses vs. Day of Week](report/expenses- vs-day-of-week) for the spending side. In GnuCash: Reports ▸ Examples ▸ Income vs. Day of Week.

The options that matter are Accounts/Accounts, General/Start Date and End Date. The chart's title shows the total, which is negative because income is a credit.

Examples

Example: with a copy of the reports/category-daily 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":"Income vs. Day of Week","options":{"Accounts":{"Accounts":["a0000000000000000000000000000003"]},"General":{"Start Date":{"absolute":"2024-03-01"},"End Date":{"absolute":"2024-03-31"}}}}}

Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "title": "Income vs. Day of Week",
    "sections": [
      {
        "blocks": [
          {
            "kind": "chart",
            "type": "pie",
            "title": [
              "Income vs. Day of Week",
              "03/01/24 to 03/31/24: -$496.00"
            ],
            "…": "…"
          },
          "…"
        ],
        "…": "…"
      },
      "…"
    ],
    "…": "…"
  }
}

Command line

red-ale exec --book book.gnucash report.run '{"report":"Income vs. Day of Week","options":{"Accounts":{"Accounts":["a0000000000000000000000000000003"]},"General":{"Start Date":{"absolute":"2024-03-01"},"End Date":{"absolute":"2024-03-31"}}}}'

It prints:

{
  "title": "Income vs. Day of Week",
  "sections": [
    {
      "blocks": [
        {
          "kind": "chart",
          "type": "pie",
          "title": [
            "Income vs. Day of Week",
            "03/01/24 to 03/31/24: -$496.00"
          ],
          "…": "…"
        },
        "…"
      ],
      "…": "…"
    },
    "…"
  ],
  "…": "…"
}

MCP tool call

Tool call:

{"name":"report.run","arguments":{"report":"Income vs. Day of Week","options":{"Accounts":{"Accounts":["a0000000000000000000000000000003"]},"General":{"Start Date":{"absolute":"2024-03-01"},"End Date":{"absolute":"2024-03-31"}}}}}

Result:

{
  "structuredContent": {
    "title": "Income vs. Day of Week",
    "sections": [
      {
        "blocks": [
          {
            "kind": "chart",
            "type": "pie",
            "title": [
              "Income vs. Day of Week",
              "03/01/24 to 03/31/24: -$496.00"
            ],
            "…": "…"
          },
          "…"
        ],
        "…": "…"
      },
      "…"
    ],
    "…": "…"
  }
}

Template GUID: 5e2d129f28d14df881c3e47e3053f604 · Script: example/daily-reports.rhai

Options

Accounts

  • Include Sub-Accounts (boolean, default true): Include sub-accounts of all selected accounts.
  • Accounts (accountList, default []): Report on these accounts, if chosen account level allows.

Display

  • Show Totals (boolean, default true): Show the total balance in legend?
  • 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 "Income vs. Day of Week"): 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.
  • 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.