# Can hledger reports reflect custom budget months?

**URL:** https://forum.plaintextaccounting.org/t/can-hledger-report-reflect-custom-budget-months/871
**Category:** General
**Tags:** hledger
**Created:** [September 2, 2026, 12:32pm UTC](https://forum.plaintextaccounting.org/t/can-hledger-report-reflect-custom-budget-months/871 "2026-09-02T12:32:32Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![chocolatine](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/chocolatine/32/184_2.png) [@chocolatine](https://forum.plaintextaccounting.org/u/chocolatine)
#### Post date: [September 2, 2026, 12:32pm UTC](https://forum.plaintextaccounting.org/t/can-hledger-report-reflect-custom-budget-months/871/1 "2026-09-02T12:32:32Z")

</div>

Hello everyone,  
I'm looking for a way to provide a custom date interval to an hledger command.

My use case is the following:  
I have a CLI tool helping me decide for every week which "budget month" it is part of (e.g., when a week overlaps two months, it decides which month the week belongs to). I don't like splitting weeks, and this is the solution I've come up with.

Now, I would love to use hledger's reporting capabilities with a monthly query  
`hledger --no-conf --file ~/path/to/my-journal.journal incomestatement -p 2024 -M`  
to reflect this. Right now, the expenses will be tied to their respective month.

Is their any way to achieve this?

Let me know if anything is not clear, I'll be happy to provide more details.

---

<div class="post-metadata">

### Author: ![simonmic](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/simonmic/32/1_2.png) [@simonmic](https://forum.plaintextaccounting.org/u/simonmic)
#### Post date: [September 2, 2026, 1:22pm UTC](https://forum.plaintextaccounting.org/t/can-hledger-report-reflect-custom-budget-months/871/2 "2026-09-02T13:22:23Z")

</div>

Hello,

I guess you want to keep the transaction dates accurate. But I suppose you could record adjusted budgeting dates as [https://hledger.org/1.52/hledger.html#secondary-dates](https://hledger.org/1.52/hledger.html#secondary-dates), and run your budget reports with `--date2` ?

---

<div class="post-metadata">

### Author: ![chocolatine](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/chocolatine/32/184_2.png) [@chocolatine](https://forum.plaintextaccounting.org/u/chocolatine)
#### Post date: [September 2, 2026, 6:45pm UTC](https://forum.plaintextaccounting.org/t/can-hledger-report-reflect-custom-budget-months/871/3 "2026-09-02T18:45:42Z")

</div>

Hi,  
Thanks for the prompt reply and many more thanks for the awesome tool that is Hledger!  
I'm not sure secondary date is what I'm looking for. From what I understand from the page you linked, secondary date allow to link two dates to a single posting.  
My goal is not to keep transaction dates accurate.  
My goal is to group budget week in their "correct" budget month.

Let's take 2024 as an example. My tool output a Json dividing a year into budget month as I explained earlier.

```auto
  {
    "name": "January",
    "weeks": [
      {
        "start_date": "2024-01-01",
        "end_date": "2024-01-07",
        "start_day": "Mon"
      },
      {
        "start_date": "2024-01-08",
        "end_date": "2024-01-14",
        "start_day": "Mon"
      },
      {
        "start_date": "2024-01-15",
        "end_date": "2024-01-21",
        "start_day": "Mon"
      },
      {
        "start_date": "2024-01-22",
        "end_date": "2024-01-28",
        "start_day": "Mon"
      }
    ]
  },
  {
    "name": "February",
    "weeks": [
      {
        "start_date": "2024-01-29",
        "end_date": "2024-02-04",
        "start_day": "Mon"
      },
      {
...

```

As you can see, the first week of February starts in January. What I would really want is for Hledger to use this timeframe when doing a query that spans over months (e.g., January runs from 01-01 to 01-28)

Hope that makes it a bit more clear.

Cheers.

---

<div class="post-metadata">

### Author: ![adept](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/adept/32/36_2.png) [@adept](https://forum.plaintextaccounting.org/u/adept)
#### Post date: [September 2, 2026, 8:24pm UTC](https://forum.plaintextaccounting.org/t/can-hledger-report-reflect-custom-budget-months/871/4 "2026-09-02T20:24:11Z")

</div>

I think this implies that you can't or do not want to use '-b' /'-e' with your custom dates. Am I right? If I am - could you elaborate why?

Perhaps something like this would work: `hledger run `with a script that your tool genrated. Script will contain 12 commands, one per "month", with custom begin/end dates, and perhaps with `--total-only`

---

<div class="post-metadata">

### Author: ![chocolatine](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/chocolatine/32/184_2.png) [@chocolatine](https://forum.plaintextaccounting.org/u/chocolatine)
#### Post date: [September 3, 2026, 7:38am UTC](https://forum.plaintextaccounting.org/t/can-hledger-report-reflect-custom-budget-months/871/5 "2026-09-03T07:38:05Z")

</div>

I did not know about the `-b`/`-e` flags. I'm currently using `-p "start_date..end_date"` to specify the date period for my queries. Is there any difference between the two approaches?

With the current output of my tool, I'm able to generate a monthly query that includes the correct weeks. My goal now is to glue the queries together to have a yearly report, divided by my budget month.

---

<div class="post-metadata">

### Author: ![adept](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/adept/32/36_2.png) [@adept](https://forum.plaintextaccounting.org/u/adept)
#### Post date: [September 3, 2026, 7:52am UTC](https://forum.plaintextaccounting.org/t/can-hledger-report-reflect-custom-budget-months/871/6 "2026-09-03T07:52:53Z")

</div>

They are the same (-p is a speedy of what -b and -e give you). Did you try `run` with 12 separate queries?

---

<div class="post-metadata">

### Author: ![chocolatine](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/chocolatine/32/184_2.png) [@chocolatine](https://forum.plaintextaccounting.org/u/chocolatine)
#### Post date: [September 3, 2026, 8:48am UTC](https://forum.plaintextaccounting.org/t/can-hledger-report-reflect-custom-budget-months/871/7 "2026-09-03T08:48:49Z")

</div>

Yes, I ran:

```auto
hledger --no-conf --file path/to/my/journals/2024.journal run -- \
 incomestatement -p 2024-01-01..2024-01-29 -- \ # january,
 incomestatement -p 2024-01-29..2024-03-04 -- \ # february,
 incomestatement -p 2024-03-04..2024-04-01 # and so on...

```

The output is a table for each query, not a single table with a column for each month as I was hoping.

`hledger run` is nonetheless a nice addition to my toolkit.

Ideally, what I was hoping to do with `hledger` is to "stack up" multiple `--period ...` in one command.

```auto
hledger --no-conf --file --file path/to/my/journals/2024.journal incomestatement -p budget-month1 -p budget-month2

```

and get as the output one table with the period per column.

---

<div class="post-metadata">

### Author: ![adept](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/adept/32/36_2.png) [@adept](https://forum.plaintextaccounting.org/u/adept)
#### Post date: [September 3, 2026, 11:05am UTC](https://forum.plaintextaccounting.org/t/can-hledger-report-reflect-custom-budget-months/871/8 "2026-09-03T11:05:32Z")

</div>

EDIT: actually `CompoundBalanceCommandSpec` does not specify reporting periods, ignore me.

`incomestatement` is just a thin wrapper around `compoundBalanceCommand`. I feel like it should be easy to write a new custom script/custom binary (a-la those available in hledger/scripts) that read your periods from args or file, constructs `CompoundBalanceCommandSpec`with your custom periods and feeds it to `compoundBalanceCommand`. See `hledger/bin/hledger-report1.hs` in the repo for a skeleton code that could be used as a starting point, if you are so inclined.

This is probably easier that trying to add some sort of generic "custom report period spec" to hledger which by necessity would have to be more flexible and more general than what's necessary for your specific case.

---

<div class="post-metadata">

### Author: ![chocolatine](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/chocolatine/32/184_2.png) [@chocolatine](https://forum.plaintextaccounting.org/u/chocolatine)
#### Post date: [September 17, 2026, 6:51am UTC](https://forum.plaintextaccounting.org/t/can-hledger-report-reflect-custom-budget-months/871/9 "2026-09-17T06:51:17Z")

</div>

Hello everyone, sorry for the late response.

I was very bummed to read your edit @adept 😢 but it is what it is.

Since there is no easy way to pass a custom date period to the `balance` command, I gave up and documented the limitation in my reporting tool. This is acceptable as I can still get the values I need, just not in a single query.

Out of curiosity, how hard do you think it might be to allow the `balance` command to expose a custom reporting period? I'm a complete noob in Haskell (i.e., that is I never wrote a single line of code in this language) so I would probably not able to contribute anyway.

Cheers.
