One challenging app (for me!)

I want to make the “best buy” app helping customers to find cheepest shops. Of course, when we look for the single products, piece of cake, columns are: PRODUCT, SHOP, PRICE and then the list with filterng the product and order increasing by price gives proper answer.

But the challenge for me is when I want to have it also for different product baskets. E.g. I have:

“Small basket” with milk, bread and butter
“Medium basket” with the previous plus cookies and eggs.

Getting the choice small/medium basket is easy, but challenge is to get such output, e.g. for small basket:

SMALL BASKET:
3 items

SHOP A: 9,05 $ >
SHOP B: 10,25 $ >

Detail gives the list of items for this basket in specific shop!

Challenging also for U?

With choice of the basket I got now using relation+lookup the following:

SMAL BASKET:
3 ITEMS

milk shop A 2,25 $
bread shop A 1,25 $
butter shop A 2,75 $
milk shop B 2,05 $
bread shop B 1,45 $
butter shop B 3,95 $

For me this is a great success, but now I am stuck for getting the subtotal lines for shops and not the detailed ones for products!

Help!