Create new date column based on other date columns

Hi!
I’m new to KNIME and looking for a standard way of defining a new date column. I have a table with two date columns, and would like to create a new one (third) based on this logic:
NEW_DATE = min(DATE_COL_1, DATE_COL_2, <TODAY’S DATE>)
Can I use any standard nodes to achieve this, or do I need to write Java code?
Thanks!

With the new 3.6 release there is a new node you should give a try: The Column Expressions node comes with the Expressions extensions. Just pass your table with the two dates to the Column Expressions node and inject the current date as flow variable from a Date&Time Input node. With this being done, you can easily implement the logic your logic.

1 Like

As @Marten_Pfannenschmidt suggested the new Column Expressions node, I thought I would pull together a quick workflow for this example, since I hadn’t had a chance to use it yet myself. I hope it helps!

2018-07-12%2006_54_26-KNIME%20Analytics%20Platform

2018-07-12%2007_41_38-Output%20table%20-%203_42%20-%20Column%20Expressions

DateTimeColumnExpressions.knwf (12.4 KB)

5 Likes

Hi @ScottF

I can’t find this Node after upgrade in Node Repository nor in NodePit. Where is it? :slight_smile:

Br,
Ivan

Hi,

you have to install the KNIME Expressions extension and then it can be found under KNIME Labs.

Cheers,
Moritz

2 Likes

Got it! Thank you!
Ivan

Thanks for the help. It solved my problem!
BR,
Johan