Re: Display the total balance of multiple accounts (net income)

2018-05-03 Thread o1bigtenor
On Thu, May 3, 2018 at 11:40 AM, Yuri Khan  wrote:
> On Thu, May 3, 2018 at 7:05 PM o1bigtenor  wrote:
>
>> On Thu, May 3, 2018 at 12:48 AM, Yuri Khan  wrote:
>> > What I ended up doing for similar needs was to write a Python script. It
>> > reads in a journal, runs a register query on it, then tallies by date
> and
>> > account, and renders the resulting dataset into a Jinja template that
>> > produces a D3-based graph report.
>
>> That script sounds very interesting.
>> Would you be willing to post it here - - - say as an attachment?
>
> Why not.
>
> Actually, I edited/parameterized out my personal bookkeeping peculiarities
> and pushed them to GitHub:
>
> https://github.com/yurikhan/ledger-d3


Thank you - - - grin - - - now I have to take time from using ledger
to digging around
to try to learn more about it - - - oh well - - - if only life weren't
quite so full!

Dee

-- 

--- 
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.


Re: Display the total balance of multiple accounts (net income)

2018-05-03 Thread Shane
Thanks for this! I was poking around with the Python module earlier.

On Thursday, May 3, 2018 at 9:40:25 AM UTC-7, Yuri Khan wrote:
>
> On Thu, May 3, 2018 at 7:05 PM o1bigtenor  > wrote: 
>
> > On Thu, May 3, 2018 at 12:48 AM, Yuri Khan  > wrote: 
> > > What I ended up doing for similar needs was to write a Python script. 
> It 
> > > reads in a journal, runs a register query on it, then tallies by date 
> and 
> > > account, and renders the resulting dataset into a Jinja template that 
> > > produces a D3-based graph report. 
>
> > That script sounds very interesting. 
> > Would you be willing to post it here - - - say as an attachment? 
>
> Why not. 
>
> Actually, I edited/parameterized out my personal bookkeeping peculiarities 
> and pushed them to GitHub: 
>
> https://github.com/yurikhan/ledger-d3 
>

-- 

--- 
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.


Re: Display the total balance of multiple accounts (net income)

2018-05-03 Thread Shane
Not quite. The output of the first command only shows one date for each of 
the entries and the second command has multiple lines per day.

On Thursday, May 3, 2018 at 10:01:11 AM UTC-7, Jostein Berntsen wrote:
>
> On 02.05.18,16:12, Shane wrote: 
> > Unfortunately, this still doesn't solve my issue with having multiple 
> lines 
> > per day for some of reports. Example of trying to plot my net worth: 
> > 
> > led reg ^ass ^lia --market --collapse --total-data 
> > 
> > ... 
> > 2018-03-08 3183.86 
> > 2018-03-08 3162.64 
> > 2018-03-09 3158.05 
> > 2018-03-09 3148.87 
> > 2018-03-09 3099.16 
> > 2018-03-10 3085.49 
> > 2018-03-10 3072.22 
> > ... 
> > 
> > The desired output: 
> > 
> > ... 
> > 2018-03-08 3162.64 
> > 2018-03-09 3099.16 
> > 2018-03-09 3072.22 
> > ... 
> > 
> > On Wednesday, May 2, 2018 at 3:03:49 PM UTC-7, Chris Berkhout wrote: 
> > > 
> > > On 2 May 2018 at 20:37, Shane  
> wrote: 
> > > 
> > >> I'm trying to plot my net income (income - taxes): 
> > >> 
> > >> led bal -e 2018-04-30 bal inc 2018 --collapse 
> > >> 
> > > 
> > > To plot it over time you would use the reg command: 
> > > 
> > > ledger reg -e 2018-04-30 inc 2018 -J 
> > > 
>
> What about this reg command? 
>
> ledger reg -e 2018-04-30 inc 2018 --subtotal -J 
>
> or this group-by bal command? 
>
> ledger --group-by 'format_date(date, "%Y/%m")' bal inc 2018 --collapse -J 
>
>
> Jostein 
>
>
>

-- 

--- 
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.


Re: Display the total balance of multiple accounts (net income)

2018-05-03 Thread Jostein Berntsen
On 02.05.18,16:12, Shane wrote:
> Unfortunately, this still doesn't solve my issue with having multiple lines 
> per day for some of reports. Example of trying to plot my net worth:
> 
> led reg ^ass ^lia --market --collapse --total-data
> 
> ...
> 2018-03-08 3183.86
> 2018-03-08 3162.64
> 2018-03-09 3158.05
> 2018-03-09 3148.87
> 2018-03-09 3099.16
> 2018-03-10 3085.49
> 2018-03-10 3072.22
> ...
> 
> The desired output:
> 
> ...
> 2018-03-08 3162.64
> 2018-03-09 3099.16
> 2018-03-09 3072.22
> ...
> 
> On Wednesday, May 2, 2018 at 3:03:49 PM UTC-7, Chris Berkhout wrote:
> >
> > On 2 May 2018 at 20:37, Shane  wrote:
> >
> >> I'm trying to plot my net income (income - taxes):
> >>
> >> led bal -e 2018-04-30 bal inc 2018 --collapse
> >>
> >
> > To plot it over time you would use the reg command:
> >
> > ledger reg -e 2018-04-30 inc 2018 -J
> >

What about this reg command?

ledger reg -e 2018-04-30 inc 2018 --subtotal -J

or this group-by bal command?

ledger --group-by 'format_date(date, "%Y/%m")' bal inc 2018 --collapse -J 


Jostein


-- 

--- 
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.


Re: Display the total balance of multiple accounts (net income)

2018-05-03 Thread Yuri Khan
On Thu, May 3, 2018 at 7:05 PM o1bigtenor  wrote:

> On Thu, May 3, 2018 at 12:48 AM, Yuri Khan  wrote:
> > What I ended up doing for similar needs was to write a Python script. It
> > reads in a journal, runs a register query on it, then tallies by date
and
> > account, and renders the resulting dataset into a Jinja template that
> > produces a D3-based graph report.

> That script sounds very interesting.
> Would you be willing to post it here - - - say as an attachment?

Why not.

Actually, I edited/parameterized out my personal bookkeeping peculiarities
and pushed them to GitHub:

https://github.com/yurikhan/ledger-d3

-- 

--- 
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.


Re: Display the total balance of multiple accounts (net income)

2018-05-03 Thread o1bigtenor
On Thu, May 3, 2018 at 12:48 AM, Yuri Khan  wrote:
> On Thu, May 3, 2018 at 6:12 AM Shane  wrote:
>
>> Unfortunately, this still doesn't solve my issue with having multiple
> lines per day for some of reports.
>
> What I ended up doing for similar needs was to write a Python script. It
> reads in a journal, runs a register query on it, then tallies by date and
> account, and renders the resulting dataset into a Jinja template that
> produces a D3-based graph report.

That script sounds very interesting.
Would you be willing to post it here - - - say as an attachment?

Dee

-- 

--- 
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.


Re: Display the total balance of multiple accounts (net income)

2018-05-02 Thread Yuri Khan
On Thu, May 3, 2018 at 6:12 AM Shane  wrote:

> Unfortunately, this still doesn't solve my issue with having multiple
lines per day for some of reports.

What I ended up doing for similar needs was to write a Python script. It
reads in a journal, runs a register query on it, then tallies by date and
account, and renders the resulting dataset into a Jinja template that
produces a D3-based graph report.

-- 

--- 
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.


Re: Display the total balance of multiple accounts (net income)

2018-05-02 Thread Chris Berkhout
Right. For my report I also just wanted the final value for each day. I did
it like this:

ledger ... | tac | sort -usk 1,1

It reverses the lines, then takes the first value it sees for each day
(those options are "unique", and "stable", with "key" being the date
column).

On 3 May 2018 at 01:12, Shane  wrote:

> Unfortunately, this still doesn't solve my issue with having multiple
> lines per day for some of reports. Example of trying to plot my net worth:
>
> led reg ^ass ^lia --market --collapse --total-data
>
> ...
> 2018-03-08 3183.86
> 2018-03-08 3162.64
> 2018-03-09 3158.05
> 2018-03-09 3148.87
> 2018-03-09 3099.16
> 2018-03-10 3085.49
> 2018-03-10 3072.22
> ...
>
> The desired output:
>
> ...
> 2018-03-08 3162.64
> 2018-03-09 3099.16
> 2018-03-09 3072.22
> ...
>
> On Wednesday, May 2, 2018 at 3:03:49 PM UTC-7, Chris Berkhout wrote:
>>
>> On 2 May 2018 at 20:37, Shane  wrote:
>>
>>> I'm trying to plot my net income (income - taxes):
>>>
>>> led bal -e 2018-04-30 bal inc 2018 --collapse
>>>
>>
>> To plot it over time you would use the reg command:
>>
>> ledger reg -e 2018-04-30 inc 2018 -J
>>
>> --
>
> ---
> 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.
>

-- 

--- 
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.


Re: Display the total balance of multiple accounts (net income)

2018-05-02 Thread Shane
Unfortunately, this still doesn't solve my issue with having multiple lines 
per day for some of reports. Example of trying to plot my net worth:

led reg ^ass ^lia --market --collapse --total-data

...
2018-03-08 3183.86
2018-03-08 3162.64
2018-03-09 3158.05
2018-03-09 3148.87
2018-03-09 3099.16
2018-03-10 3085.49
2018-03-10 3072.22
...

The desired output:

...
2018-03-08 3162.64
2018-03-09 3099.16
2018-03-09 3072.22
...

On Wednesday, May 2, 2018 at 3:03:49 PM UTC-7, Chris Berkhout wrote:
>
> On 2 May 2018 at 20:37, Shane  wrote:
>
>> I'm trying to plot my net income (income - taxes):
>>
>> led bal -e 2018-04-30 bal inc 2018 --collapse
>>
>
> To plot it over time you would use the reg command:
>
> ledger reg -e 2018-04-30 inc 2018 -J
>
>

-- 

--- 
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.


Re: Display the total balance of multiple accounts (net income)

2018-05-02 Thread Shane
This makes it a lot easier. thanks.

On Wednesday, May 2, 2018 at 3:03:49 PM UTC-7, Chris Berkhout wrote:
>
> On 2 May 2018 at 20:37, Shane  wrote:
>
>> I'm trying to plot my net income (income - taxes):
>>
>> led bal -e 2018-04-30 bal inc 2018 --collapse
>>
>
> To plot it over time you would use the reg command:
>
> ledger reg -e 2018-04-30 inc 2018 -J
>
>

-- 

--- 
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.


Re: Display the total balance of multiple accounts (net income)

2018-05-02 Thread Chris Berkhout
On 2 May 2018 at 20:37, Shane  wrote:

> I'm trying to plot my net income (income - taxes):
>
> led bal -e 2018-04-30 bal inc 2018 --collapse
>

To plot it over time you would use the reg command:

ledger reg -e 2018-04-30 inc 2018 -J

-- 

--- 
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.


Re: Display the total balance of multiple accounts (net income)

2018-05-02 Thread Shane
Clever! Thanks so much.

On Wednesday, May 2, 2018 at 2:40:27 PM UTC-7, Martin Michlmayr wrote:
>
> * Shane  [2018-05-02 14:37]: 
> > My mistake. It still shows all three lines when I use your corrected 
> > command. The --collapse flag only collapses my income and tax sub 
> accounts 
> > to their root accounts. 
>
> ledger  | tail -n 1 
>
> -- 
> Martin Michlmayr 
> http://www.cyrius.com/ 
>

-- 

--- 
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.


Re: Display the total balance of multiple accounts (net income)

2018-05-02 Thread Martin Michlmayr
* Shane  [2018-05-02 14:37]:
> My mistake. It still shows all three lines when I use your corrected 
> command. The --collapse flag only collapses my income and tax sub accounts 
> to their root accounts.

ledger  | tail -n 1

-- 
Martin Michlmayr
http://www.cyrius.com/

-- 

--- 
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.


Re: Display the total balance of multiple accounts (net income)

2018-05-02 Thread Shane
Correction: when I only specify the income account, it does indeed show one 
line, but this is my gross income. I include 2018 to subtract my taxes so I 
can see the balance of my take-home income.

On Wednesday, May 2, 2018 at 2:37:49 PM UTC-7, Shane wrote:
>
> My mistake. It still shows all three lines when I use your corrected 
> command. The --collapse flag only collapses my income and tax sub accounts 
> to their root accounts.
>
> On Wednesday, May 2, 2018 at 2:33:40 PM UTC-7, Jostein Berntsen wrote:
>>
>> On 02.05.18,11:37, Shane wrote: 
>> > I'm trying to plot my net income (income - taxes): 
>> > 
>> > led bal -e 2018-04-30 bal inc 2018 --collapse 
>> > 
>> > The output looks like: 
>> > 
>> > 1,000.00 USD  exp 
>> >-4,000.00 USD  inc 
>> >  
>> >-3,000.00 USD 
>> > 
>> > When I want to generate a format for gnuplot (by adding the -J 
>> argument), 
>> > the output still shows all three lines. 
>> > 
>> > led bal -e 2018-04-30 bal inc 2018 --collapse -J 
>> > 
>> > 2018-04-21 1,000.00 
>> > 2018-04-21 -4,000.00 
>> > 2018-04-21 -3,000.00 
>> > 
>> > How do I only display the *total*--the -3,000.00 USD? 
>> > 
>>
>> The --collapse command should work here, but it seems like you have the 
>> bal commend two times in your command above. Can you check if this works 
>> for you instead? 
>>
>> ledger bal -e 2018-04-30 inc --collapse -J 
>>
>>
>> Jostein 
>>
>

-- 

--- 
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.


Re: Display the total balance of multiple accounts (net income)

2018-05-02 Thread Shane
My mistake. It still shows all three lines when I use your corrected 
command. The --collapse flag only collapses my income and tax sub accounts 
to their root accounts.

On Wednesday, May 2, 2018 at 2:33:40 PM UTC-7, Jostein Berntsen wrote:
>
> On 02.05.18,11:37, Shane wrote: 
> > I'm trying to plot my net income (income - taxes): 
> > 
> > led bal -e 2018-04-30 bal inc 2018 --collapse 
> > 
> > The output looks like: 
> > 
> > 1,000.00 USD  exp 
> >-4,000.00 USD  inc 
> >  
> >-3,000.00 USD 
> > 
> > When I want to generate a format for gnuplot (by adding the -J 
> argument), 
> > the output still shows all three lines. 
> > 
> > led bal -e 2018-04-30 bal inc 2018 --collapse -J 
> > 
> > 2018-04-21 1,000.00 
> > 2018-04-21 -4,000.00 
> > 2018-04-21 -3,000.00 
> > 
> > How do I only display the *total*--the -3,000.00 USD? 
> > 
>
> The --collapse command should work here, but it seems like you have the 
> bal commend two times in your command above. Can you check if this works 
> for you instead? 
>
> ledger bal -e 2018-04-30 inc --collapse -J 
>
>
> Jostein 
>

-- 

--- 
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.


Re: Display the total balance of multiple accounts (net income)

2018-05-02 Thread Jostein Berntsen
On 02.05.18,11:37, Shane wrote:
> I'm trying to plot my net income (income - taxes):
> 
> led bal -e 2018-04-30 bal inc 2018 --collapse
> 
> The output looks like:
> 
> 1,000.00 USD  exp
>-4,000.00 USD  inc
> 
>-3,000.00 USD
> 
> When I want to generate a format for gnuplot (by adding the -J argument), 
> the output still shows all three lines.
> 
> led bal -e 2018-04-30 bal inc 2018 --collapse -J
> 
> 2018-04-21 1,000.00
> 2018-04-21 -4,000.00
> 2018-04-21 -3,000.00
> 
> How do I only display the *total*--the -3,000.00 USD?
> 

The --collapse command should work here, but it seems like you have the 
bal commend two times in your command above. Can you check if this works 
for you instead? 

ledger bal -e 2018-04-30 inc --collapse -J


Jostein

-- 

--- 
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.


Display the total balance of multiple accounts (net income)

2018-05-02 Thread Shane
I'm trying to plot my net income (income - taxes):

led bal -e 2018-04-30 bal inc 2018 --collapse

The output looks like:

1,000.00 USD  exp
   -4,000.00 USD  inc

   -3,000.00 USD

When I want to generate a format for gnuplot (by adding the -J argument), 
the output still shows all three lines.

led bal -e 2018-04-30 bal inc 2018 --collapse -J

2018-04-21 1,000.00
2018-04-21 -4,000.00
2018-04-21 -3,000.00

How do I only display the *total*--the -3,000.00 USD?

-- 

--- 
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.