Sorry I haven't replied earlier. I expected to get notified by email on a 
response, but evidently I set up something wrong.

Anyway, I'm using ledger, not hledger. The behaviour you describe for 
hledger is *not* what ledger does. In particular, with your example, the 
output I get is:

$ ledger -f ledger.dat reg -ME -b 2014/1/1 RareExpense 
 14-Jul-01 - 14-Jul-31         (Expens:RareExpense)           1           1

I can understand why ledger has this behaviour if no start or end-date is 
present. However, I don't find it sensible that the above does not contain 
the empty months until from January till July. I would expect exactly the 
behaviour that hledger seems to have.


On Monday, March 2, 2015 at 6:57:06 PM UTC+1, Simon Michael (sm) wrote:
>
> On 3/1/15 3:42 AM, santa...@gmail.com <javascript:> wrote: 
> > Running 
> >     
> >     ledger  -M --empty reg ^Expenses:RareExpense 
> > 
> > produces a summary of Expenses:RareExpense, where each month is 
> > represented, even if there was no activity for a given month. 
> > The behaviour of --empty with regards to the beginning and end of the 
> > considered period surprises me, however. 
> > 
> > First of all, the above does not include the no-activity months after 
> the 
> > last activity-month until now. I.e. if my last RareExpense was in July 
> > 2014, it seems I get no empty months listed from August 2014 and 
> onwards. 
> > 
> > This behaviour is also consistently applied when using the --begin 
> > predicate. For instance, had I no RareExpense in 2014 except for in July 
> > (and none until now either), the following: 
> >     
> >     ledger  -M --begin "2014/01" --empty reg ^Expenses:RareExpense 
> > 
> > seems to give me a singleton list with only July represented. 
> > 
> > That behaviour does not seem sensible to me. Am I doing something wrong 
> or 
> > is this a bug? 
>
> You haven't specified the exact behaviour you expect. I think you 
> wouldn't want it to automatically show periods up to today, eg say you 
> were working with an old ledger from 2000 (or 1500!). 
>
> When start/end dates have been specified (with -b/-e/-p/date:), 
> hledger will extend the report to those dates when -E/--empty is used. Eg: 
>
> 2014/7/1 
>   (Expenses:RareExpense)   1 
>
> $ hledger reg -ME -b 2014/1/1 RareExpense 
> 2014/01                                              0             0 
> 2014/02                                              0             0 
> 2014/03                                              0             0 
> 2014/04                                              0             0 
> 2014/05                                              0             0 
> 2014/06                                              0             0 
> 2014/07                 Ex:RareExpense               1             1 
>
> Another option would be to extend the report, either with or without -E, 
> to the journal's start/end date (the earliest and latest date of all 
> postings in the journal file(s)). 
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to