Assigning Data from one column to another with different associated timing interval

Hi Everyone,

I`m struggling to find a solution to resolve my issue regarding assign some data from one series of a dataset to a specific column. You can see the excel file at the below link, I have illustrated what I have and what I want.

Please excuse my amateur coding literacy.

I have two General Data Columns:

  1. General data&time 2) General Attraction
    Also, I have two other Individual Customer Columns (User Data):
  2. Customer data&time 2) Profit of Customer

I want to assign data from General Data to User Data with equal or the closest timing that matched and create a set of new 4 columns:

  1. matched data & time 2) general attraction, timing wised associated to the user 3) user data & time. 4) profit

Would you please help me how can I resolve this problem with Knime?

Any help is appreciated.

Hi there @alexafshari,

welcome to KNIME Community!

So if I got you right you want to keep two customer columns as they are and add General attraction column where Purchase time is closest to Recorde time? I have checked your data and was wondering about logic regarding row 3 as date is not same (06.01 vs 07.01.). Is that mistake or if not can you explain logic behind it?


Hi Ivan

Thanks for your reply and reviewing my issue with this much precision, yes you are right it was a mistype, I revised it. The dates are the same 07.01 for both colums.


1 Like

Hi @alexafshari,

ok. I played with it a bit and seems you need to go with loop in this case. (Was hoping for simple solution with Cell Replacer doing the trick but values are not identical :frowning:).

Anyways you should go row by row, calculate time difference from Purchase time to recorde time and take recorde time and General attraction where diff is minimum.

Here is workflow that should get you started:
2020_05_06_Calculating_min_time_diff.knwf (134.1 KB)

Hope this helps!



HI @ipazin

Thanks for your amazing solution I tried it, it was awesome.


1 Like