On 04/02/23 12:24, Chary Chary wrote:
Dan,

OK, thanks. But just some clarification.


If I look at the following  simple Transaction:

2000-01-02 * "Buying something in Euro"
     Assets:NL:ING:Payment               -100 EUR
     Expenses:Misc                                100 EUR

Then does it have position or not?

Transactions do not have positions. Transactions contain postings. Each posting has an account and a position (although they are not spelled out like that in the data structure, see below).

I can see *tarnsaction, postings*, *units*, but I do not see a *position*

However if I use beanquery, then beanquery does see the position:

There is not alway a 1:1 mapping between the Beancount data model and the tables definitions used by beanquery. In this case, the 'position' column is obtained from the units and cost fields in the Posting object.

https://github.com/beancount/beanquery/blob/f224aa8161495b9fddb7c7f712e5103b8b8b59e3/beanquery/query_env.py#L1054-L1058

I don't know why it was chosen to have a 'position' column but not an 'amount' column in beanquery. Most likely because a position without a cost is pretty much equivalent to an amount from a beanquery point of view.

So, the position here is  100    EUR,  however in Python data structure, it does not have a cost, which is, per your definition, is not a position.

So, once again, what is the definition of a *position *then?

I forgot an "optional" in the definition of Position:

A Position is an Amount with attached an /optional/ Cost specification

I think https://beancount.github.io/docs/beancount_query_language.html#data-types does quite good job in explaining the data types used in BQL and what they represent.

Cheers,
Dan

--
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/d3508404-780f-c55b-9b81-ba0e8fdd65c0%40grinta.net.

Reply via email to