I have a table like this:
As you can see some prices had increased or decreased (more than one line with the same product), and some had not so far (only one line)
In the example these are Bananen and Butter.
I only want to have a new table for things which have changed.
like this
Bananen 1,49 - 1,19 = -0,30 = - 44,7 %
Butter 1,65 - 2,29 = +0,64 = + 38.8 %
I only want to see, where prices got up or down.
Not those with one line - they are unchanged.
This means that some products can have more than one line - that depends how often prices where changed.
(a min/max calculation within a product).
How would you code that?
As I see min/max prices is only possible for the whole table, but not by product.
I can imagine to select a distinct(product) into a 2nd table to have each product only once.
From there perhaps scan that table and compare it with the 1st. table and let a function write into an array per product.
But maybe it is easier perhaps.
Thanks for help
Klaus
Btw - Butter has become very expensive in Germany - the price is for 250 g +39 % within 2 months!
How is that in your country?
Peace worldwide - it starts here...
As you can see some prices had increased or decreased (more than one line with the same product), and some had not so far (only one line)
In the example these are Bananen and Butter.
I only want to have a new table for things which have changed.
like this
Bananen 1,49 - 1,19 = -0,30 = - 44,7 %
Butter 1,65 - 2,29 = +0,64 = + 38.8 %
I only want to see, where prices got up or down.
Not those with one line - they are unchanged.
This means that some products can have more than one line - that depends how often prices where changed.
(a min/max calculation within a product).
How would you code that?
As I see min/max prices is only possible for the whole table, but not by product.
I can imagine to select a distinct(product) into a 2nd table to have each product only once.
From there perhaps scan that table and compare it with the 1st. table and let a function write into an array per product.
But maybe it is easier perhaps.
Thanks for help
Klaus
Btw - Butter has become very expensive in Germany - the price is for 250 g +39 % within 2 months!
How is that in your country?
Peace worldwide - it starts here...