Hi Dan, thank you very much.

For me 
   convert(balance, 'USD', date)
is enough. Without a proper documentation it was hard to find out how can I 
use the built-in functions, but it was so easy.

For example I was not able to find the getprice function in

   - https://beancount.github.io/docs/
   - 
   
https://docs.google.com/document/d/1RaondTJCS_IUPBHFNdT8oqFKJjVJDsfsn6JEjBG04eA/edit

There are some convert functions documented there, but it was not clear for 
me.

Thank you again for helping me.

On Tuesday, October 25, 2022 at 9:22:51 PM UTC+2 [email protected] wrote:

> On 22/10/2022 19:49, Máté Farkas wrote:
> > With a small post-process step I can solve it with this BQL:
> > 
> > SELECT
> >     year, month, last(balance) as balance, last(getprice("CHF", "USD", 
> > date)) as price
> > WHERE
> >     account ~ 'Assets'
> > GROUP BY year, month
> > ORDER BY year, month
>
> I think the convert() BQL function is what you are looking for. 
> Something like the following may do what you ask for:
>
> SELECT
> year,
> month,
> last(convert(balance, 'USD', date(year, month, 1))) AS balance
> WHERE
> account ~ 'Assets'
> GROUP BY
> year,
> month
>
> adjusting the third parameter of convert() to do what you need (which is 
> not very clear to me from the problem statement).
>
> 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/9c8a245b-7dee-4f59-84c3-af4cff7e17b9n%40googlegroups.com.

Reply via email to