Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have this table:
CustomerID, Year, Sales
1,2010,1
1,2011,1
1,2012,1
1,2013,1
1,2014,1
2,2011,1
2,2013,1
I need to create another table from the above, adding for each CustomerID all years, and set to 0 those years that the CustomerID have no sales.
CustomerID, Year, Sales
1,2010,1
1,2011,1
1,2012,1
1,2013,1
1,2014,1
2,2010,0
2,2011,1
2,2012,0
2,2013,1
2,2014,0
I just bolded the year that CustomerID 2 had no sales.
Any ideia? Thank you!
It is easier to add for all years and all customers and it doesn't change the calculations you do as it is either 0 values or null values as I suggest since it gives easier counting of sales...