Categorize data by time

I am stuck at a seemingly simple task.
I have a series of measures taken at different times, I want to put next to each measure the name of the product that was measured. For that I have a second list of production schedule where I can extract the start and end dates of each production.

My approach was using a table to variable loop but the issue is that you can’t have a time type variable (it is automatically converted to sring).

Any ideas?
I include the original data.

MEASURES.xlsx (208.1 KB)
PRODUCT_LIST.xlsx (9.0 KB)


Hey Olivier
I suggest you use the Date and Time to String Node and then the String Manipulation Node with the Join() function. By doing this, you can use the Joiner Node with the timestamp column.

Hi @Olivier_G

See this wf categorize_data_by_time.knwf (573 KB). It checks for every sensor time_stamp what product interval it matches.

gr. Hans

1 Like

Thanks a lot Hans.
I studied your workflow which works correctly but I can not understand why.

What appens in the Rule Engine when you compare a date/time with a string?

My guess is that the date/time is automatically converted to a string and than the string is compared by alphabetical order. Am I right?

Anyway I will try to reverse the loop order, looping through products (small list) an not through measures (thousands of rows) in order to be faster.

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