Expression node does not support date / timestamp fields?

Hi,

Is it correct that the Expression node (available from version 5.3) does not support date / timestamp fields?

Hi @HTBUI ,

welcome to the KNIME forum.
Correct, to date the new Expression node does not support Date&Time. For this use case, please, continue to use the Column Expressions (legacy) node for now.
We are currently in the process of migrating the Date&time nodes to the modern UI. In this process we also consider to add date&time functionality to the new Expression node. Which tasks do you need to perform?

Have a nice day,
nan

2 Likes

There are different cases I want to use:

a) Duration calculation to assign to different buckets. For example, if 0 days < Reporting Date - Due Date <= 10 days then bucket 1. If 10 days < Reporting Date - Due Date <= 30 days then bucket 2, etc.

b) Assigning a date timestamp as result. If Date timestamp in column A < date timestamp in column B then output field is column A, else column B.

It would make the Expression node more powerful if Date functions are also provided. For example, Date to Week day, Date to Quarter, Last date of a Year-Quarter, etc

1 Like

Agreed. In the mean time, I tend to use this node to split the Date&Time into formula friendly columns.

Or occasionally the Date&Time Difference Finder in simpler situations.

Edit: Looks like they replaced / deprecated my preferred node without me noticing… Here is the newer one.

1 Like

For those use cases, I would recommend Date&Time Difference – KNIME Community Hub followed by an Expression node, which contains cleaner rules.

1 Like

Thank you @nan and @iCFO for your suggestion.
If there are multiple date and datetime columns in the same source table, which need a logic to be applied, then I will have to create a separate flow for each of them, is it correct?

@nan would there be an Expression (Multi Column Dictionary) node in the future? It would be great if it also supports Date and Date Timestamp columns as input fields.

1 Like

I just use the Time&Date Part Extractor for each column. Then you have all of the detail broken out for cross referencing in a conditional formula. I especially find the #of Day / Month / Year breakout columns to be a great way to simplify formula writing as they allow for easy greater than / less than logic or math calcs.