[GNC] Find or search all expenses in a certain account

Derek Atkins derek at ihtfp.com
Fri May 1 10:45:00 EDT 2020


Hi,

Sorry to respond to an old thread, but I'm catching up on 2 months of
emails while I was heads-down on another project..

Gio Bacareza <gbacareza at gmail.com> writes:

> I'll give it a try. Thanks Adrien
>
> On Tue, Mar 10, 2020 at 11:41 AM Adrien Monteleone <
> adrien.monteleone at lusfiber.net> wrote:
>
>> That was the right criteria. I’m not sure why it isn’t working for you.
>>
>> Maybe I missed something, but you noted earlier that you have 10
>> transactions that are transfers and are fixed properly. You want to delete
>> everything else in AccountA.
>>
>> Doing a search for ‘everything else’ seems to be overkill. (especially at
>> this point) Can’t you just do one of the following:

Here's the problem with these approaches.  A register is, by definition,
the result of a search.  Specifically, it is a SPLIT searach where the
initial criteria is "split->account == register_account".

When you do a FIND from within a register, you are, by definition,
limiting your search to the *account splits*.  Transfer accounts are, by
definition, in *other* splits, not the account splits.  The reason is
that you get a search query that looks like:

  Find splits where
  Split->account == register_account AND
  ( ... your stuff ... )

So, in short, you can't do what you want from within a register because
of the way sub-searches are implemented.

The only way to do this search is to start from the CoA and search for
transactions' split-accounts that match both A and B.

Hope this helps,

>> Please remember to CC this list on all your replies.
>> You can do this by using Reply-To-List or Reply-All.

-derek

-- 
       Derek Atkins                 617-623-3745
       derek at ihtfp.com             www.ihtfp.com
       Computer and Internet Security Consultant


More information about the gnucash-user mailing list