There's no possible date common over all accounts which makes this possible.
For example, two different accounts may have different dates for their last
balance directives.

In order to carry this out using bean-query, you'd have to somehow tell it
to stop accumulating the positions after the last balance, conditional on
this per-account value. Not sure how to do that, there's no conditional on
aggregation functions in bean-query.

However, an easy way to do this would be to write a plugin that discards
all transactions after the last Balance directive in each account. Note
that this is not well-defined because a single transaction posts to
multiple accounts... if one of the postings is before that account's last
Balance directive and the other isn't, should one ignore the transaction or
not? I don't know. You might have your own opinion on that.

If you don't care to maintain the accounting equation, you could write a
custom report that sums up the positions in each account, disregarding the
transactions themselves. But then running a balance sheet or trial balance
on those won't sum up to zero.

Or ... yet another idea: you could write a plugin that inserts metadata on
postings which occur after the last Balance directive (e.g. "unverified:
TRUE") and use bean-query's WHERE clause to filter those out. That would
work. In fact, you could always leave that plugin on... if you don't use
the field, it wouldn't hurt anything else. That's the best implementation
IMO.

Choose your evil.



On Sun, May 22, 2016 at 12:25 PM, francois PEGORY <[email protected]>
wrote:

> exactly i want the date from the last Balance directive.
> regards
>
> 2016-05-18 16:32 GMT+02:00 Martin Blais <[email protected]>:
>
>> Do you want "data from the last Balance directive" or "the balances as of
>> the date of the last Balance directive in each account"?
>> Please be specific.
>>
>>
>> On Wed, May 18, 2016 at 5:46 AM, francois PEGORY <[email protected]>
>> wrote:
>>
>>> Thanks but i wanted to have the latest Balance directive not the
>>> effective Balance.
>>>
>>> Regards
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *De : *Martin Blais <[email protected]>
>>> *Envoyé le :*mardi 17 mai 2016 06:42
>>> *À : *Beancount <[email protected]>
>>> *Objet :*Re: balance
>>>
>>>
>>>
>>> bean-report <filename> balances
>>>
>>> bean-query <filename> "select account, sum(position) group by account"
>>>
>>>
>>>
>>>
>>>
>>> On Mon, May 16, 2016 at 12:26 PM, francois PEGORY <
>>> [email protected]> wrote:
>>>
>>> hello,
>>>
>>> i look for having the latest balance fro each account in my file:
>>>
>>> do you know how to have it ?
>>>
>>>
>>>
>>> regards
>>>
>>>
>>>
>>>
>>>
>>> --
>>> 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 post to this group, send email to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/beancount/CALUWbLeHGUJE6XY74MB3dH-Q7wzfcqyWzw3SLySJ5y7r_5LEUA%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/beancount/CALUWbLeHGUJE6XY74MB3dH-Q7wzfcqyWzw3SLySJ5y7r_5LEUA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>>
>>> --
>>> 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 post to this group, send email to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/beancount/CAK21%2BhO7DehN1bQbPdtGzp0P269Z7MC8-9ZoSoZW2NzvqTHuGw%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/beancount/CAK21%2BhO7DehN1bQbPdtGzp0P269Z7MC8-9ZoSoZW2NzvqTHuGw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>>
>>
>>
>

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/CAK21%2BhMNi%2BPDWx%2BfoyAiuiWrovoV%2BjOogXLq_OEiOWWB_XWGoA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to