Re: Totals for a specific commodity

2024-02-25 Thread CDT
Thank you Dan. That worked.

On Sunday, February 25, 2024 at 2:22:07 PM UTC-5 dan...@grinta.net wrote:

> On 25/02/24 18:58, CDT wrote:
> > This command gives me a list of the different purchases of that position 
> > at different prices. So if I bought some Filecoin at $5.77 and other at 
> > $7.83 (just as an example) it separates each of them out in the output 
> > 1.134 FIL {5.77 USD}, 3.345 FIL {7.83 USD}.  Is there a way to get the 
> > total number of shares across all accounts regardless of price (or maybe 
> > with an average price)?
> > 
> > I see where I can get a sum total of the amount I spent on a position by 
> > using SELECT sum(cost(position))  but I don't see anything  on getting a 
> > total number of a specific commodity (as a total).
>
> SELECT sum(units(position))
>
> or
>
> SELECT sum(position.units)
>
> The latter works only with a somewhat recent beanquery (unreleased).
>
> 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 beancount+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/6b0cfc55-4116-4589-968e-746d4d80e659n%40googlegroups.com.


Re: Totals for a specific commodity

2024-02-25 Thread Daniele Nicolodi

On 25/02/24 18:58, CDT wrote:
This command gives me a list of the different purchases of that position 
at different prices. So if I bought some Filecoin at $5.77 and other at 
$7.83 (just as an example) it separates each of them out in the output 
1.134 FIL {5.77 USD}, 3.345 FIL {7.83 USD}.  Is there a way to get the 
total number of shares across all accounts regardless of price (or maybe 
with an average price)?


I see where I can get a sum total of the amount I spent on a position by 
using SELECT sum(cost(position))  but I don't see anything  on getting a 
total number of a specific commodity (as a total).


SELECT sum(units(position))

or

SELECT sum(position.units)

The latter works only with a somewhat recent beanquery (unreleased).

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 beancount+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/488464fa-abf6-4938-9263-cee2878e06f4%40grinta.net.


Re: Totals for a specific commodity

2024-02-25 Thread CDT
This command gives me a list of the different purchases of that position at 
different prices. So if I bought some Filecoin at $5.77 and other at $7.83 
(just as an example) it separates each of them out in the output 1.134 FIL 
{5.77 USD}, 3.345 FIL {7.83 USD}.  Is there a way to get the total number 
of shares across all accounts regardless of price (or maybe with an average 
price)?

I see where I can get a sum total of the amount I spent on a position by 
using  SELECT sum(cost(position))  but I don't see anything  on getting a 
total number of a specific commodity (as a total).
On Sunday, February 25, 2024 at 12:20:45 PM UTC-5 bl...@furius.ca wrote:

> (No need to apologize, there are no dumb questions here - but maybe just 
> not much time for detailed answers.)
> Use beanquery:
> https://github.com/beancount/beanquery
>
> https://docs.google.com/document/d/1s0GOZMcrKKCLlP29MD7kHO4L88evrwWdIO0p4EwRBE0/
>
>
> On Sun, Feb 25, 2024 at 12:18 PM CDT  wrote:
>
>> I'm new to Python, coding and Beancount, so I don't mean to sound like a 
>> dunce when I ask - where do I use "SELECT sum(position) WHERE currency = 
>> 'BTC'?  
>>
>> Is that to be put in a script I create or is that used in Bean-Query or 
>> Bean-Report or something else?
>>
>> On Saturday, February 24, 2024 at 3:25:34 PM UTC-5 bl...@furius.ca wrote:
>>
>>> Just SELECT sum(position) WHERE currency = 'BTC'?
>>>
>>> On Sat, Feb 24, 2024 at 2:46 PM CDT  wrote:
>>>
 I have some commodities (lets just use BTC as an example) spread out 
 over many different accounts.

 Is there a command to get a grand total on a specific commodity (like 
 BTC) regardless of the account hierarchy?

 I couldn't find anything on this.

 -- 
 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 beancount+...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/beancount/9b8133d0-e942-44cd-bc80-db773878aa9en%40googlegroups.com
  
 
 .

>>> -- 
>> 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 beancount+...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/beancount/3b6fada2-18e8-45e1-9318-5f665424840bn%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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 beancount+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/22cb0c16-b8bf-44eb-8a1f-18bc417f8c1cn%40googlegroups.com.


Re: Totals for a specific commodity

2024-02-25 Thread CDT
Thank you.  That worked.

On Sunday, February 25, 2024 at 12:20:45 PM UTC-5 bl...@furius.ca wrote:

> (No need to apologize, there are no dumb questions here - but maybe just 
> not much time for detailed answers.)
> Use beanquery:
> https://github.com/beancount/beanquery
>
> https://docs.google.com/document/d/1s0GOZMcrKKCLlP29MD7kHO4L88evrwWdIO0p4EwRBE0/
>
>
> On Sun, Feb 25, 2024 at 12:18 PM CDT  wrote:
>
>> I'm new to Python, coding and Beancount, so I don't mean to sound like a 
>> dunce when I ask - where do I use "SELECT sum(position) WHERE currency = 
>> 'BTC'?  
>>
>> Is that to be put in a script I create or is that used in Bean-Query or 
>> Bean-Report or something else?
>>
>> On Saturday, February 24, 2024 at 3:25:34 PM UTC-5 bl...@furius.ca wrote:
>>
>>> Just SELECT sum(position) WHERE currency = 'BTC'?
>>>
>>> On Sat, Feb 24, 2024 at 2:46 PM CDT  wrote:
>>>
 I have some commodities (lets just use BTC as an example) spread out 
 over many different accounts.

 Is there a command to get a grand total on a specific commodity (like 
 BTC) regardless of the account hierarchy?

 I couldn't find anything on this.

 -- 
 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 beancount+...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/beancount/9b8133d0-e942-44cd-bc80-db773878aa9en%40googlegroups.com
  
 
 .

>>> -- 
>> 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 beancount+...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/beancount/3b6fada2-18e8-45e1-9318-5f665424840bn%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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 beancount+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/2138ab53-2373-459c-98cb-8df377d4a2bbn%40googlegroups.com.


Re: Totals for a specific commodity

2024-02-25 Thread Martin Blais
(No need to apologize, there are no dumb questions here - but maybe just
not much time for detailed answers.)
Use beanquery:
https://github.com/beancount/beanquery
https://docs.google.com/document/d/1s0GOZMcrKKCLlP29MD7kHO4L88evrwWdIO0p4EwRBE0/


On Sun, Feb 25, 2024 at 12:18 PM CDT  wrote:

> I'm new to Python, coding and Beancount, so I don't mean to sound like a
> dunce when I ask - where do I use "SELECT sum(position) WHERE currency =
> 'BTC'?
>
> Is that to be put in a script I create or is that used in Bean-Query or
> Bean-Report or something else?
>
> On Saturday, February 24, 2024 at 3:25:34 PM UTC-5 bl...@furius.ca wrote:
>
>> Just SELECT sum(position) WHERE currency = 'BTC'?
>>
>> On Sat, Feb 24, 2024 at 2:46 PM CDT  wrote:
>>
>>> I have some commodities (lets just use BTC as an example) spread out
>>> over many different accounts.
>>>
>>> Is there a command to get a grand total on a specific commodity (like
>>> BTC) regardless of the account hierarchy?
>>>
>>> I couldn't find anything on this.
>>>
>>> --
>>> 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 beancount+...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/beancount/9b8133d0-e942-44cd-bc80-db773878aa9en%40googlegroups.com
>>> 
>>> .
>>>
>> --
> 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 beancount+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/beancount/3b6fada2-18e8-45e1-9318-5f665424840bn%40googlegroups.com
> 
> .
>

-- 
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 beancount+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/CAK21%2BhP39UrfQ45SjFRm_AwrWL6ntr3oxEHdv88Jmd%2B%2BtySx%3DQ%40mail.gmail.com.


Re: Totals for a specific commodity

2024-02-25 Thread CDT
I'm new to Python, coding and Beancount, so I don't mean to sound like a 
dunce when I ask - where do I use "SELECT sum(position) WHERE currency = 
'BTC'?  

Is that to be put in a script I create or is that used in Bean-Query or 
Bean-Report or something else?

On Saturday, February 24, 2024 at 3:25:34 PM UTC-5 bl...@furius.ca wrote:

> Just SELECT sum(position) WHERE currency = 'BTC'?
>
> On Sat, Feb 24, 2024 at 2:46 PM CDT  wrote:
>
>> I have some commodities (lets just use BTC as an example) spread out over 
>> many different accounts.
>>
>> Is there a command to get a grand total on a specific commodity (like 
>> BTC) regardless of the account hierarchy?
>>
>> I couldn't find anything on this.
>>
>> -- 
>> 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 beancount+...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/beancount/9b8133d0-e942-44cd-bc80-db773878aa9en%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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 beancount+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/3b6fada2-18e8-45e1-9318-5f665424840bn%40googlegroups.com.


Re: Totals for a specific commodity

2024-02-24 Thread Martin Blais
Just SELECT sum(position) WHERE currency = 'BTC'?

On Sat, Feb 24, 2024 at 2:46 PM CDT  wrote:

> I have some commodities (lets just use BTC as an example) spread out over
> many different accounts.
>
> Is there a command to get a grand total on a specific commodity (like BTC)
> regardless of the account hierarchy?
>
> I couldn't find anything on this.
>
> --
> 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 beancount+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/beancount/9b8133d0-e942-44cd-bc80-db773878aa9en%40googlegroups.com
> 
> .
>

-- 
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 beancount+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/CAK21%2BhP3i9tNzyKpdqMRwtCaxSReBsYXQvUFs-718ZcHizmGGg%40mail.gmail.com.


Totals for a specific commodity

2024-02-24 Thread CDT
I have some commodities (lets just use BTC as an example) spread out over 
many different accounts.

Is there a command to get a grand total on a specific commodity (like BTC) 
regardless of the account hierarchy?

I couldn't find anything on this.

-- 
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 beancount+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/9b8133d0-e942-44cd-bc80-db773878aa9en%40googlegroups.com.