Re: How to only display subtotals

2021-12-21 Thread Marcin Borkowski


On 2021-12-22, at 05:45, Martin Michlmayr  wrote:

> * Marcin Borkowski  [2021-12-22 05:41]:
>> What do I tell the `bal` report to display both `Expenses:Life:Food`
>> and `Expenses:Life:Phone`, but only the subtotal for
>> `Expenses:Hobbies` (without separating `Books` and `Music`)?
>
> I don't think you can do this in a single query.

Thanks, I was afraid so.  Well, since I'm writing a program to analyze
ledger's output, I'll just output all the accounts and filter them on
the other side.

Best,

-- 
Marcin Borkowski
http://mbork.pl

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/87ee65i1j5.fsf%40mbork.pl.


Re: Categorizing spending

2021-12-21 Thread psionl0
I'm not sure I see the problem. Ledger is designed to have any categories 
in any grouping you want. You might have Expenses:Electicity, Expenses:Gas, 
Expenses:Food etc. Your bal report would list subtotals for each of these 
categories and you could do a reg report on any individual categories if 
you wanted more detail.
Eg:
2021/12/01 * Electric Company
   Expenses:Electricity   $250.00
   Bank:Mastercard

2021/12/02 * Gas Company
   Expenses:Gas   $110.00
   Bank:Mastercard

2020/12/03 * Shopping Centre
   Expenses:Food  $140.00
   Bank:Mastercard

$ ledger -f sample1.txt bal | cat
$-500.00  Bank:Mastercard
 $500.00  Expenses
 $250.00Electricity
 $140.00Food
 $110.00Gas

   0

$ ledger -f sample1.txt reg "Food" | cat
20-Dec-03 Shopping Centre   Expenses:Food   $140.00 
 $140.00

$ ledger -f sample1.txt reg "Mastercard" and @Electric | cat
21-Dec-01 Electric Company  Bank:Mastercard$-250.00 
$-250.00

On Tuesday, December 21, 2021 at 7:56:04 AM UTC+8 Aaron Stacy wrote:

> Hi, I'm looking for suggestions for categorizing spending (not so much 
> things like paycheck, brokerage transactions, etc, but stuff like credit 
> card spending for budgeting). My ledger has around 2800 transactions over 
> about 2 years, so it's not a ton of data, but it seems like enough that I 
> could leverage something smarter than just string matching the transaction 
> narrations.
>
> Does anyone have recommendations for categorizing spending?
>
> I'm thinking of applying a full text search index as follows:
>
> - Each expense account is a "document".
> - The document contents is the narration of every transaction for that 
> account.
> - To categorize a new transaction, use an engine like Lucene 
>  to or sklearn.TfidfVectorizer and pick the 
> most likely account.
>
> Any thoughts on this approach? (aside from being over-engineered. I'm an 
> engineer, IDK what to tell you it's what I do)
>
> Thanks!
>

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/db8bb8fa-a948-4020-acf5-5e81617ee439n%40googlegroups.com.


Re: How to only display subtotals

2021-12-21 Thread Martin Michlmayr
* Marcin Borkowski  [2021-12-22 05:41]:
> What do I tell the `bal` report to display both `Expenses:Life:Food`
> and `Expenses:Life:Phone`, but only the subtotal for
> `Expenses:Hobbies` (without separating `Books` and `Music`)?

I don't think you can do this in a single query.

-- 
Martin Michlmayr
https://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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/YcKthmBB05sva0E8%40jirafa.cyrius.com.


How to only display subtotals

2021-12-21 Thread Marcin Borkowski
Hi all,

Assume I use this account structure:

Expenses:Hobbies:Books
Expenses:Hobbies:Music
Expenses:Life:Food
Expenses:Life:Phone

What do I tell the `bal` report to display both `Expenses:Life:Food` and
`Expenses:Life:Phone`, but only the subtotal for `Expenses:Hobbies`
(without separating `Books` and `Music`)?

TIA,

-- 
Marcin Borkowski
http://mbork.pl

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/87fsqli73r.fsf%40mbork.pl.


Re: Categorizing spending

2021-12-21 Thread o1bigtenor
On Mon, Dec 20, 2021 at 5:56 PM Aaron Stacy  wrote:
>
> Hi, I'm looking for suggestions for categorizing spending (not so much things 
> like paycheck, brokerage transactions, etc, but stuff like credit card 
> spending for budgeting). My ledger has around 2800 transactions over about 2 
> years, so it's not a ton of data, but it seems like enough that I could 
> leverage something smarter than just string matching the transaction 
> narrations.
>
> Does anyone have recommendations for categorizing spending?
>
> I'm thinking of applying a full text search index as follows:
>
> - Each expense account is a "document".
> - The document contents is the narration of every transaction for that 
> account.
> - To categorize a new transaction, use an engine like Lucene to or 
> sklearn.TfidfVectorizer and pick the most likely account.
>
> Any thoughts on this approach? (aside from being over-engineered. I'm an 
> engineer, IDK what to tell you it's what I do)

Greetings

Not sure how many transactions in my file (a command would be wonderful).
My file is more complicated as I run a few sole proprietorships as well.
I started with the GIFI codes from my gooberment. For me that just wasn't
enough granularity (most would likely find my system WAY over the top!!!)
so I added 6 more digits (sometimes I could use a couple more in fact) in a
.xx.xx.xx pattern. I enter my additions into the document (the list of GIFI
codes) that I started with. That document started as an 8 page file. Its now
a 54 page file after about 7 years of use. Dunno how many actual line items
but I separate out a lot of things to help me do good long term thinking
(the type of product works better than that for longer term.

When I was looking for record
keeping (most commonly called accounting) software the level of granularity
I thought I needed (and am now using) would have moved me into a cost
area enjoyed by very large companies. I have found that ledger enables me
to fairly quickly and very very accurately keep my record keeping and is
so very easy to pull reports from. I tend to need to ask questions to find
good queries but I am finding the support here excellent and so I now
endorse 'ledger' for this use. I can call any level of account (and even
combinations of accounts) as a 'document' and every transaction is
listed. As for categorization - - - well - - - I look to my account doc and
find the area the item - - - or service, belongs in and if its a new to me
so far - - -well I add a new account number and - - - we're off to the
races.

HTH

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/CAPpdf59FSC4hi04_%3DE5TShmcEvoMTKoyUPAsj9ZEGb%2B8kqPOpA%40mail.gmail.com.


Re: Categorizing spending

2021-12-21 Thread Daniele Nicolodi

On 21/12/2021 00:55, Aaron Stacy wrote:
Hi, I'm looking for suggestions for categorizing spending (not so much 
things like paycheck, brokerage transactions, etc, but stuff like credit 
card spending for budgeting). My ledger has around 2800 transactions 
over about 2 years, so it's not a ton of data, but it seems like enough 
that I could leverage something smarter than just string matching 
the transaction narrations.


Does anyone have recommendations for categorizing spending?

I'm thinking of applying a full text search index as follows:

- Each expense account is a "document".
- The document contents is the narration of every transaction for that 
account.
- To categorize a new transaction, use an engine like Lucene 
 to or sklearn.TfidfVectorizer 
 and pick the most likely account.


Any thoughts on this approach? (aside from being over-engineered. I'm an 
engineer, IDK what to tell you it's what I do)


I use Beancount and to assign accounts to transactions I use a machine 
learning classifier trained on my existing ledger implemented using sklearn.


This works reasonably well for recurring transactions but is not 
infallible. I found that putting a threshold on the confidence score 
from the classifier is essential for not ending up with completely bogus 
account assignments.


Cheers,
Dan

--

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/c34a24e0-2b47-9f73-f94a-2687b6b64360%40grinta.net.