Discussion:
Tags wihtout specifying expense account
Jungle Boogie
2018-09-08 20:14:39 UTC
Permalink
Hi All,

What's up with this?

$ hledger bal Expenses:Beverage:2018:Tea -p thismonth
$8.82 Expenses:Beverage:2018:Tea
--------------------
$8.82

$ hledger bal Expenses tag:tea -p thismonth
$8.92 Expenses
$8.82 Beverage:2018:Tea
$0.10 Taxes:2018:CRV
--------------------
$8.92

So far, so good. Now let's take out the account...

$ hledger bal tag:tea -p thismonth
$-4.94 Assets:Cash:Money
$8.92 Expenses
$8.82 Beverage:2018:Tea
$0.10 Taxes:2018:CRV
--------------------
$3.98

What's up with the difference here? I'm sure hledger is operating correctly, I just don't understand what is actually happening, but I do see 3.98+4.94 is the same amount from the two above.


Thanks!
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Simon Michael
2018-09-08 20:25:15 UTC
Permalink
Hi Jungle Boogie,

I don't know what your entries are like, but I'll guess it's because of

Also remember that postings inherit the tags of their parent transaction.
http://hledger.org/manual.html#queries

and maybe you tagged the transactions instead of just the expense postings ?
Post by Jungle Boogie
Hi All,
What's up with this?
$ hledger bal Expenses:Beverage:2018:Tea -p thismonth
$8.82 Expenses:Beverage:2018:Tea
--------------------
$8.82
$ hledger bal Expenses tag:tea -p thismonth
$8.92 Expenses
$8.82 Beverage:2018:Tea
$0.10 Taxes:2018:CRV
--------------------
$8.92
So far, so good. Now let's take out the account...
$ hledger bal tag:tea -p thismonth
$-4.94 Assets:Cash:Money
$8.92 Expenses
$8.82 Beverage:2018:Tea
$0.10 Taxes:2018:CRV
--------------------
$3.98
What's up with the difference here? I'm sure hledger is operating correctly, I just don't understand what is actually happening, but I do see 3.98+4.94 is the same amount from the two above.
Thanks!
--
You received this message because you are subscribed to the Google Groups "hledger" group.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
jungle Boogie
2018-09-10 15:42:23 UTC
Permalink
Hi Simon,

I have a couple different ways of tagging transactions, and the examples
are below.

2018/09/09 * 711
Expenses:Beverage:2018:Tea $1.98 ;tea:
Expenses:Beverage:2018:Drink $2.97
Assets:Cash:Money -$4.95

2018/09/05 * WalMart ;tea:
Expenses:Beverage:2018:Tea $2.86
Assets:Cash:Money

2018/09/03 * 711 ;tea:
Expenses:Beverage:2018:Tea $1.98
Expenses:Taxes:2018:CRV $0.10
Assets:Cash:Money -$2.08

As you see, the tag is applied in two different ways and one of the ways,
also includes an additional line item specific to the tagged transaction.

Is there a right or wrong way to use the tags in my example?

Thanks!
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Simon Michael
2018-09-10 16:08:12 UTC
Permalink
I have a couple different ways of tagging transactions, and the examples are below.
2018/09/09 * 711
Expenses:Beverage:2018:Drink $2.97
Assets:Cash:Money -$4.95
A posting tag. "tag:tea" will match only the Tea expense.
Expenses:Beverage:2018:Tea $2.86
Assets:Cash:Money
Expenses:Beverage:2018:Tea $1.98
Expenses:Taxes:2018:CRV $0.10
Assets:Cash:Money -$2.08
Transaction tags. "tag:tea" will match those transactions (when doing print, eg) or all of those postings (when doing balance or register, eg). Because postings inherit their transaction's tags.

Does that make sense ?
As you see, the tag is applied in two different ways and one of the ways, also includes an additional line item specific to the tagged transaction.
Is there a right or wrong way to use the tags in my example?
That I can't say! What's your goal ?
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
jungle Boogie
2018-09-10 16:18:28 UTC
Permalink
Hi Simon,
Post by Simon Michael
Post by jungle Boogie
Is there a right or wrong way to use the tags in my example?
That I can't say! What's your goal ?
With your explanation, I think it works as expected and for my use
cases. I'll likely always include the account name when querying data.

Thanks!
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Simon Michael
2018-09-10 17:14:18 UTC
Permalink
Post by jungle Boogie
With your explanation, I think it works as expected and for my use
cases. I'll likely always include the account name when querying data.
Sounds good. You already have those postings categorised by account so I think adding the tag doesn't buy you anything.
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...