I'm not sure whether it's possible to cast the data type, but I do know
that selecting and ordering by account metadata are both possible, if
obscure. Try something like this:

  select getitem(open_meta(account), 'rate-of-interest') as rate, account
order by rate

Note this is still selecting transactions, not accounts directly, so you
won't see rows for any accounts that don't have transactions, etc. Anyway,
it does show how you can include account metadata in your queries.

Matt


On Sat, Jul 13, 2024 at 3:11 PM Shaarad Dalvi <[email protected]>
wrote:

> Hi folks,
>
> I have a few accounts decorated with some metadata - like for fixed
> deposit accounts, I put the rate of interest as the metadata
>
> 2024-07-01 open Assets:MyBank:MyFixedDeposit1 INR
>   rate-of-interest: "7.2%"
>
> ... And so on for other deposit accounts
>
> I am wondering if I can somehow see "the fixed deposit accounts that are
> giving me the least rate of interest right now"?
>
> I tried using entry_meta and any_meta but no success so far.
>
> Furthermore, if filtering on account metadata is possible, is it possible
> to cast the metadata value of a given key to another data type (like
> integer/float) and ORDER BY that?
>
> Thanks!
>
> --
> 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/CAL1KmEGhzeBac426ge0KRZL_PeNyg3CK6fqr-tpXYBXgut3-xw%40mail.gmail.com
> <https://groups.google.com/d/msgid/beancount/CAL1KmEGhzeBac426ge0KRZL_PeNyg3CK6fqr-tpXYBXgut3-xw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAFpGnbNv%3DH4gS-dkRUb6DR985Er1dgW50HVYW2545WNkYRp6Og%40mail.gmail.com.

Reply via email to