If I have the following 3 records with the same unique identifier Seller Part Number1: B1234...
Seller Part Number1: B1234
Location1: Kansas
Part Number1: A1234
Customer Price1: $10
Seller Price1: $8
Volume1: 20
Seller Part Number1: B1234
Location2: Georgia
Part Number2: A2345
Customer Price2: $12
Seller Price1: $8
Volume2: 15
Seller Part Number1: B1234
Location3: Colorado
Part Number1: A3456
Customer Price3: $14
Seller Price2: $6
Volume3: 10
Comparing the same Seller Part Number1, how do I correctly calculate
#1 The difference between a location's Customer Price and the lowest Customer Price and multiply by the location's volume
e.g. Location2 would be Location2 Customer Price $12 - Location1 Customer Price since it is the lowest $10 x Location2 Volume 15
$12-$10 x 15 = $30 lost money due to pricing irregularities
#2 The difference between the lowest Seller price and each location(e.g. Location1 would be $10 - $6 x 20)
$6 is the lowest Seller Price2
Since the Seller Part Number1 is the same, all the information should be the same, BUT IT IS NOT. I want to understand the difference. Can anyone here help? I was told to use a WHERE function, but not sure how to implement it.