Hi,

Do you have different currencies? Here is a (complex) example that I run to value and convert with a specific year.

number(only("CHF", convert(sum(value(position, #"2020-12-31")), "CHF", #"2020-12-31")))


Let's deconstruct that from the inner parts

sum(value(position, #"2020-12-31"))
this sums up the value of a position (using prices from 2020-12-31)

convert(..., "CHF", #"2020-12-31")
convert everything to CHF with FX as of 2020-12-31

number(only("CHF", ...))
Now take only the CHF out of this (as everything was converted to CHF, this is actually only CHF)) and then take the number


If you don't have different currencies or prices involved it becomes a lot simpler and you can drop those parts.


Regards,

Patrick



On 29.11.2020 16:50, Chary Chary wrote:
Hi, everybody

is there a way to get a single number report with bean-query

e.g. I want all Expenses for all the period in one number.

The maximum I got so far is listing all expense accounts and their balance. To to get a total expenses I would have to dump it all in Excel and sum there.

So, I want something like

SUM(COST(position)) WHERE account ~'Expenses'

But this does not work

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] <mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/31497363-986a-4745-a202-526236c532d8n%40googlegroups.com <https://groups.google.com/d/msgid/beancount/31497363-986a-4745-a202-526236c532d8n%40googlegroups.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/891fdfdc-ef39-8224-4c83-795683486bc8%40ch.tario.org.

Reply via email to