Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
hvfalcao
Creator
Creator

Resident Load + New Field Values

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!

1 Reply
petter
Partner - Champion III
Partner - Champion III

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...

2015-09-22 #1.PNG