I'm trying to create a report true SQL BI that compares the sales of a product/customer between two given date frames.
For example, I want to see the difference in sale from item "111" from (01/01/2008 till 31/12/2008) and (01/01/2009 until 31/01/09.)
All data is in the same table, so no external joins are needed.
Data output must give something like this:
Item Date 1 Date 2 Difference
111 2000 1000 -100%
But the second thing is, when date 1 has no data for the period it still must show date 2.
Item Date 1 Date 2 Difference
111 0 1000 100%
I just can't seem to get this in my head and this is really frustrating me for quite some time now.
Any help would be highly appreciated
Comments