Skip to content

multiperiod balance report should be more like bs in showing empty columns ? #1396

Closed

Description

@simonmichael

Multiperiod bs and balance both omit leading/trailing periods which contain no transactions (January, here):

2020-02-01
  (assets)    $1

2020-03-01
  (assets)    $1

2020-03-02
  (assets)    $-1
$ hledger -f a.j bs --change -M
Balance Sheet 2020-02-01..2020-03-02 (Balance Changes)

             || Feb  Mar 
=============++==========
 Assets      ||          
-------------++----------
 assets      ||  $1    0 
-------------++----------
             ||  $1    0 
=============++==========
 Liabilities ||          
-------------++----------
-------------++----------
             ||          
=============++==========
 Net:        ||  $1    0 
$ hledger -f a.j bal -M
Balance changes in 2020-02-01..2020-03-31:

        || Feb  Mar 
========++==========
 assets ||  $1    0 
--------++----------
        ||  $1    0 

You can override this by specifying an explicit report period, with bs, but not with balance:

$ hledger -f a.j bs --change -M -b 202001 -e 202004
Balance Sheet 2020Q1 (Balance Changes)

             || Jan  Feb  Mar 
=============++===============
 Assets      ||               
-------------++---------------
 assets      ||   0   $1    0 
-------------++---------------
             ||   0   $1    0 
=============++===============
 Liabilities ||               
-------------++---------------
-------------++---------------
             ||               
=============++===============
 Net:        ||   0   $1    0 
$ hledger -f a.j bal -M -b 202001 -e 202004
Balance changes in 2020-02-01..2020-03-31:

        || Feb  Mar 
========++==========
 assets ||  $1    0 
--------++----------
        ||  $1    0 

Activity

  1. added
    A-BUGSomething wrong, confusing or sub-standard in the software, docs, or user experience.
    on Nov 17, 2020
  2. simonmichael commented on Nov 17, 2020

    @simonmichael
    MemberAuthor

    Ah it's because balance also hides leading/trailing all-zero columns by default, so you must add -E/--empty:

    $ hledger -f a.j bal -M -b 202001 -e 202004 -E
    Balance changes in 2020Q1:
    
            || Jan  Feb  Mar 
    ========++===============
     assets ||   0   $1    0 
    --------++---------------
            ||   0   $1    0 
    

    Should they be more consistent ? Which behaviour is more robust and useful with typical real-world data ?

  3. changed the title [-]multiperiod balance report should be more respectful of a specified report period[/-] [+]multiperiod balance report should be more like bs in showing empty columns ?[/+] on Nov 17, 2020
  4. Xitian9 commented on Dec 4, 2020

    @Xitian9
    Collaborator

    I definitely would agree with this change; it has annoyed me mildly in the past. It's a simple change; I'll look into it when I get some time.

  5. Xitian9 commented on Dec 4, 2020

    @Xitian9
    Collaborator

    Just linking to a previous discussion on the topic of empty columns in #1269

  6. Xitian9 commented on Dec 14, 2020

    @Xitian9
    Collaborator

    A question regarding fixing this issue:
    Making this change obviously adds a bunch of extra column an the start and end in some cases: for example, test 2 in intervals.test.

    hledger -f balance-multicol.journal balance -p 'monthly in 2013' --no-total
    >>>
    Balance changes in 2013Q1:
    
                     || Jan  Feb  Mar  Apr  May  Jun  Jul  Aug  Sep  Oct  Nov  Dec
    =================++============================================================
     assets          ||   0    1    0    0    0    0    0    0    0    0    0    0
     assets:cash     ||   0    1    0    0    0    0    0    0    0    0    0    0 
     assets:checking ||   0    0    1    0    0    0    0    0    0    0    0    0 
    

    This is even if the most recent posting is in March 2013, as in this case. Should we automatically intersect the report span with the journal span? This would leave us with no way of getting reports beyond the span of the journal without adding dummy transactions, but might be a reasonable compromise on usability.

  7. Xitian9 commented on Dec 14, 2020

    @Xitian9
    Collaborator

    A noteable thing about making this change is that the report title will change, which may actually be a good thing. In the above example it would change to:

    hledger -f balance-multicol.journal balance -p 'monthly in 2013' --no-total
    >>>
    Balance changes in 2013Q1:
    
                     || Jan  Feb  Mar 
    =================++===============
     assets          ||   0    1    0 
     assets:cash     ||   0    1    0 
     assets:checking ||   0    0    1 
    
  8. the-solipsist commented on Jan 6, 2021

    @the-solipsist
    Collaborator

    A side note: The report title is probably better off mentioning the dates, rather than "Balance changes in 2020Q1", since the meaning of "Q1", "Q2", etc., aren't fixed. For instance, in Australia, Q1 refers to the period July 1–September 30, whereas in India, it is usually the period April 1–June 30.

  9. simonmichael commented on Jan 6, 2021

    @simonmichael
    MemberAuthor

    That's interesting, thanks for mentioning.

  10. Xitian9 commented on Jan 7, 2021

    @Xitian9
    Collaborator

    Future considerations for localisation aside, I think this issue might be resolved now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-BUGSomething wrong, confusing or sub-standard in the software, docs, or user experience.balance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions