I have a field with10 categories. Every category has 10 products, and every product has his own price and the sales revenue.
Now, for eache category, I want to find the first product by revenue, and compare it with the first product (of the same category) which contains the word "Mom". This has to be done for all categories.
Now, at the moment, I can't. But I'm going to give you an example here.
Suppose we have 3 categories, like pizza, meat and vegetables. For the category 'Pizza', we have the products 'pizza with ham' that costs €5.00, 'pizza with potatoes' that costs €6.00 exc exc.
In other words, we have this situation:
FAMILY PRODUCT PRICE
pizza pizza with ham €5.00
pizza pizza with potatoes €6.00
pizza .................... ............
meat sausages €4.00
meat .......... ..........
The most sold pizza is 'pizza with ham'. Now, I want to find the price of the pizza that contains the word 'potatoes' and compare it with the price of 'pizza with ham' (that's, how said before, the pizza with the highest revenue), indipendent of the position of the pizza with potatoes. The comparison has to be done as the price of the pizza with potatoes divided by the price of the first pizza (ham).
The result has to be a table that contains, for each family: the product with the research I want (in this example: 'potatoes'), the first product with highest revenue (pizza with ham) and the price variation between these products.