I actually found the solution for my questions

*select *SUM(COST(position)) WHERE account ~'Expenses'   works just fine


On Monday, November 30, 2020 at 5:20:23 PM UTC+1 [email protected] wrote:

> Hi,
>
>
> this is bean-query, I just limited it to the select part, for your case it 
> would be something like
>
>
> number(only("CHF", convert(sum(value(position, #"2020-12-31")), "CHF", 
> #"2020-12-31"))) WHERE account ~'Expenses'
>
>
> Regards,
>
> Patrick
>
>
> On 30.11.2020 16:02, Chary Chary wrote:
>
> Patrick, 
>
> thanks for the answer, but I am afraid I do not have enough knowledge to 
> understand your answer.
>
> What you shave show is not a bean-query language, this looks time elements 
> of python code
>
> Can you in this case give me some broader and complete source of code and 
> I will try to get my head around
>
> Regards.
>
> On Sunday, November 29, 2020 at 4:58:33 PM UTC+1 [email protected] 
> wrote:
>
>> 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].
>> 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/3ca0d4b1-d0ad-4d8c-be56-01a449ec4c90n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/beancount/3ca0d4b1-d0ad-4d8c-be56-01a449ec4c90n%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/50995ac6-f31e-49c6-b59a-b1519c664283n%40googlegroups.com.

Reply via email to