Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A wish for an "average-only" report #1012

Closed
amybailey opened this issue Apr 20, 2019 · 5 comments · Fixed by #2086
Closed

A wish for an "average-only" report #1012

amybailey opened this issue Apr 20, 2019 · 5 comments · Fixed by #2086
Labels
A-WISH Some kind of improvement request, hare-brained proposal, or plea. balance balancesheet cashflow incomestatement

Comments

@amybailey
Copy link

There are a (admittedly few) times when I want to see only the average balance of an account over some interval. For example when estimating a monthly budget amount for expenses, or bringing printed data to show a financial advisor, or just when the width of a report is unwieldy.

One possible implementation could be to add an --average-only option. This option would only make sense when using one of the interval options -D, -W, -M, -Q, or -Y

Output might look something like this:

$ hledger balance expenses:utilities -M --average-only --flat --drop 2

Average Monthly Balance yyyy/mm/dd-yyyy/mm/dd

            ||     Average
============++=============
 electric   ||     $128.63
 naturalgas ||      $55.88
 phone      ||      $78.59
 trash      ||      $11.72
 water      ||      $63.33
------------++-------------
            ||     $338.15

@simonmichael simonmichael added A-WISH Some kind of improvement request, hare-brained proposal, or plea. balance balancesheet cashflow incomestatement labels Apr 20, 2019
@simonmichael
Copy link
Owner

That looks pretty good.

--average & --average-only would be mutually exclusive, and we'd describe them that way and give an error if both are used ? Or (simpler, preferred): the last one on the command line wins.

--average-only would be available on all the commands that currently support --average.

@simonmichael
Copy link
Owner

Would adding -T/--total still be allowed ?

@amybailey
Copy link
Author

Thinking about this more, this request is really just an output modifier. Perhaps it doesn't justify a new command line option but rather an %(average) field in --format string?

@simonmichael
Copy link
Owner

I think --format isn't supported with multicolumn reports.

@simonmichael simonmichael added needs:code To unblock: needs code/code updates needs:design To unblock: needs more thought/planning, leading to a spec/plan labels Aug 4, 2021
@hiqua
Copy link

hiqua commented Aug 4, 2021

FYI: A way to do this with https://github.com/BurntSushi/xsv

hl b -S -MA -O csv | xsv select Account,Average | xsv fmt -t '\t' | column -t

Does not work well with multiple currencies.

Xitian9 added a commit to Xitian9/hledger that referenced this issue Sep 13, 2023
Add a flag --only-summary for multi-column balance reports, which only
displays the summary columns (--row-total, --average). This is useful
when there are many columns (a weekly summary over many years) where
you're only interested in the average (or some other summary).
Xitian9 added a commit to Xitian9/hledger that referenced this issue Sep 13, 2023
Add a flag --only-summary for multi-column balance reports, which only
displays the summary columns (--row-total, --average). This is useful
when there are many columns (a weekly summary over many years) where
you're only interested in the average (or some other summary).
Xitian9 added a commit to Xitian9/hledger that referenced this issue Sep 17, 2023
Add a flag --summary-only for multi-column balance reports, which does
not display the main date columns for a report, but only displays the
summary columns (--row-total, --average). This is useful when there are
many columns (a weekly summary over many years) where you're only
interested in the average (or some other summary).
simonmichael pushed a commit that referenced this issue Oct 6, 2023
Add a flag --summary-only for multi-column balance reports, which does
not display the main date columns for a report, but only displays the
summary columns (--row-total, --average). This is useful when there are
many columns (a weekly summary over many years) where you're only
interested in the average (or some other summary).
@simonmichael simonmichael removed needs:design To unblock: needs more thought/planning, leading to a spec/plan needs:code To unblock: needs code/code updates labels Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-WISH Some kind of improvement request, hare-brained proposal, or plea. balance balancesheet cashflow incomestatement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants