I have a list of product codes and their sale dates. I want to only count the first ever sale of that product, then SUM the first sales by month of sale. So if Product A was sold in Feb, Mar and Nov, it only gets counted in Feb.
Here is a badly copied table
Product Code Sales Date WHAT I WANT
-------------------------------------------
A1234 01/02/2014 COUNT THIS
B3333 03/02/2014 COUNT THIS
C5555 06/03/2014 COUNT THIS
A1234 09/03/2014 DON’T COUNT
F567 15/04/2014 COUNT THIS
P000 25/05/2014 COUNT THIS
B3333 01/01/2015 DON’T COUNT
A1234 06/01/2015 DON’T COUNT
P000 19/01/2015 DON’T COUNT
B3333 26/01/2015 DON’T COUNT
K5678 20/02/2015 COUNT THIS
I want my end result to be a graph with months down the side and then a count of first times a product is sold.
Does this make sense? I tried using MIN, but it makes everything AGG, which stops you comparing a date with a date.