beancount> JOURNAL WHERE number > 5
ERROR: Syntax error near 'WHERE' (at 8)
  JOURNAL WHERE number > 5
          ^
beancount> help journal
Select a journal of some subset of postings. This command is a
convenience and converts into an equivalent Select statement, designed
to extract the most sensible list of columns for the register of a list
of entries as a table.

The general form of a JOURNAL statement loosely follows SQL syntax:

   JOURNAL <account-regexp> [FROM_CLAUSE]

See the SELECT query help for more details on the FROM clause.
beancount>


On Thursday, October 22, 2020 at 4:59:07 AM UTC-7, Martin Blais wrote:
>
> Both can be used, but FROM can be used only with transaction columns and 
> WHERE can be used only with posting columns.
>
> On Thu, Oct 22, 2020, 04:11 Red S <redst...@gmail.com <javascript:>> 
> wrote:
>
>> FROM applies to a transaction, WHERE applies to postings. I may be 
>> mistaken, but WHERE cannot be used with JOURNAL for this reason, in my 
>> understanding.
>>
>> This might possibly be what you want:
>> SELECT date,description,account,position,balance WHERE account ~ 
>> "^Expenses" AND number > 800
>>
>> https://beancount.github.io/docs/beancount_query_language.html
>>
>>
>> On Thursday, October 22, 2020 at 12:47:32 AM UTC-7, Varac wrote:
>>>
>>> Can you help me with an example please ? 
>>>
>>>     bean-query ~/beancount/personal.beancount "JOURNAL 'Expenses' FROM 
>>> number > 800" 
>>>
>>> didn't work for me. 
>>>
>>> Greetings, Varac 
>>>
>>> Excerpts from Martin Blais's message of Oktober 22, 2020 3:20 
>>> vormittags: 
>>> > I think you want "number" 
>>> > 
>>> https://github.com/beancount/beancount/blob/v2/beancount/query/query_env.py#L1662
>>>  
>>> > 
>>> > 
>>> > On Tue, Oct 20, 2020 at 3:57 AM Varac <va...@varac.net> wrote: 
>>> > 
>>> >> Hi, 
>>> >> 
>>> >> new beancount user here, I'd like to filter a journal query by 
>>> amount, 
>>> >> i.e. show all transactions with an amount > X euros. 
>>> >> I tried but nothing seems to work for me i.e.: 
>>> >> 
>>> >>     "JOURNAL 'Expenses' FROM year = 2014 AND cost_number > '100'" 
>>> >>     ERROR: Invalid column name 'cost_number' in FROM clause context. 
>>> >> 
>>> >> 
>>> >> Greetings, Varac 
>>> >> 
>>> >> -- 
>>> >> 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 bean...@googlegroups.com. 
>>> >> To view this discussion on the web visit 
>>> >> 
>>> https://groups.google.com/d/msgid/beancount/1603180319.e43z90u5bm.astroid%40rocinante.none
>>>  
>>> >> . 
>>> >> 
>>> > 
>>> > -- 
>>> > 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 bean...@googlegroups.com. 
>>> > To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/beancount/CAK21%2BhObYOfajfJ5V6kf%3DSjcwdmsEza54%3D7XkeKoGL_gBhXNjQ%40mail.gmail.com.
>>>  
>>>
>>> > I think you want "number" 
>>> > 
>>> https://github.com/beancount/beancount/blob/v2/beancount/query/query_env.py#
>>>  
>>> > L1662 
>>> > 
>>> > 
>>> > On Tue, Oct 20, 2020 at 3:57 AM Varac <va...@varac.net> wrote: 
>>> > 
>>> >     Hi, 
>>> > 
>>> >     new beancount user here, I'd like to filter a journal query by 
>>> amount, 
>>> >     i.e. show all transactions with an amount > X euros. 
>>> >     I tried but nothing seems to work for me i.e.: 
>>> > 
>>> >         "JOURNAL 'Expenses' FROM year = 2014 AND cost_number > '100'" 
>>> >         ERROR: Invalid column name 'cost_number' in FROM clause 
>>> context. 
>>> > 
>>> > 
>>> >     Greetings, Varac 
>>> > 
>>> >     -- 
>>> >     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 bean...@googlegroups.com. 
>>> >     To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/ 
>>> >     beancount/1603180319.e43z90u5bm.astroid%40rocinante.none. 
>>> > 
>>> > -- 
>>> > 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 bean...@googlegroups.com. 
>>> > To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/ 
>>> > beancount/ 
>>> > CAK21%2BhObYOfajfJ5V6kf%3DSjcwdmsEza54%3D7XkeKoGL_gBhXNjQ%
>>> 40mail.gmail.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 bean...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/beancount/dcb54226-1a9f-4a89-979c-d4ccc905679do%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/beancount/dcb54226-1a9f-4a89-979c-d4ccc905679do%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 beancount+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/63e9a6c2-d6f9-4e57-9eb6-6f8936caa1fdo%40googlegroups.com.

Reply via email to