I like it.
Done:
https://bitbucket.org/blais/beancount/commits/90472db4ef144783408844a22cbc5dc4a54ba39b


On Mon, Nov 14, 2016 at 9:38 AM, Stefano Zacchiroli <[email protected]> wrote:

> Coming from the Ledger half of the Free accounting world, I'm used to
> the fact that transaction metadata propagates down to postings. Please
> correct me if I'm wrong, but this doesn't seem to be the case in
> Beancount, at least according to my experiments with bean-query.
>
> I'm fine with Beancount model for this. But when querying it is
> sometimes handy to have a way to lookup a metadata *first* in a posting,
> and then fallback to the parent transaction if the metadata key is not
> defined in the posting. Is there a way to implement this in Beancount
> SQL language? E.g., is there a boolean (or n-ary) operator that takes
> two (or more) values and return the first of them that is not NULL?
>
> Either way, it might be helpful to have a SQL function that will lookup
> a metadata key first in a posting and then fallbacks on the parent
> transaction. Attached you can find a proposal for such a function,
> called ANY_META for lack of better naming ideas.
>
> It works for me, but I'm open to better suggestion on how to
> "hierarchically" lookup metadata within transactions.
>
> Cheers.
> --
> Stefano Zacchiroli . [email protected] . upsilon.cc/zack . . o . . . o . o
> Computer Science Professor . CTO Software Heritage . . . . . o . . . o o
> Former Debian Project Leader . OSI Board Director  . . . o o o . . . o .
> « the first rule of tautology club is the first rule of tautology club »
>
> --
> 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/20161114143819.ry4mhqp2ermizo3c%40upsilon.cc.
> 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%2BhNT%3Ddm%3D0k%3D4EBcZYYGyNMejrw%2B%2BV0CHcfC8Hu-omcqX%3DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to