12 Replies Latest reply: May 5, 2010 6:11 AM by gmanoilov RSS

    filter invoices based on items inside

    gmanoilov

      Hello!

      My question is probably easy enough and I hope you don't blame my ignorance :)

      So, let's suppose that we have a simple table with the following data:

       

      INVOICE NO. ITEM AMOUNT

      ---------------------------------------------------------------------------------------------------

      111 AAA 10

      111 BBB 15

      222 AAA 5

      333 CCC 17

      333 BBB 4

      444 AAA 3

       

      Now I would like to count all invoices which contain AAA items, but do NOT contain BBB items.

      I guess that I maybe have to use aggr() here, but I do not quite realize how to do it.

      Thanks in advance!