Trouble dis-aggregating data on Knime (One numeric row to many)

Hi everyone,

I am trying to dissagregate this data to make it match our standard workflow for Sales Funnel, data is different because it is coming from a different BU.

 

Need to convert this:

date    Leads    NewSales
1/2/2017    2    1
1/3/2017    3    2
           
Into this

date    Leads    NewSales
1/2/2017    1    1
1/2/2017    1    0
1/3/2017    1    1
1/3/2017    1    1
1/3/2017    1    0
           
 

Have been trying for a with different methods without success, any suggestions? 

Maybe a piece of code on java or R can help, if anybody knows how

 

 

* (The screenshots are from the top and bottom of my dataset)

 

 

Thanks in advance

Julio

I understand you want to expand by Leads columns, but how do you decide which rows have 1 for New Sales? Or do you just want to have n rows in total (n - Leads) with m rows having 1 for new sales (m - New Sales) and n-m rows having 0 there?

That looks like the easiest, but also dummy solution. Just add another column for Leads - NewSales, and use one row to many to duplicate rows based on new sales and no new sales (new column). Update values to 1 and stack back, then update leads to 1 and remove the dummy column.

Not very efficient though, but it depends on your data. On my crappy PC, 300 rows, 10,000 Leads and 5000 NewSales per row, took around 30 sec to process. 

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.