Inserting Date in Missing Spaces

I have a table populated that is missing the date on the new rows added on the table. Is there a node which will let me insert current date? I tried row based rule filter and tried : $DateAdded$ = NULL => code to insert todays date

You can use column expression node for that
and do and if isMissing check and use the date function to return todays date if true otherwise use default column value
br

Hi -

I am not seeing this COLUMN EXPRESSIONS NODE in KNIME. Can you provide more assistance?

Hi @areej31 ,

Column expression is a nide from labs. You can add the extension for it OR use the rule engine node to check about missing values from a column and set a new one as you said.

image

MISSING $Field$ => $today$
TRUE => $Field$

And save it as a append column.

Tks,

Denis

2 Likes

Ahh thanks this works, I was putting MISSING after the column. Ok so where you have $today$ is there a variable I can create to capture today’s date or would I have to do it manually each time ? Anything through date configuration node? and call that rule in the rule engine?

You can create today’s date as variable using Create Date&time Range node
br

2 Likes

Hi @areej31 ,

As @Daniel_Weikert told here, you can use the Create Date&Time range node, saying that you need the execution now option checked to set the “today/now” information at the begin and the end date configuration.

Set you fixed just 1 data and name it as you wish like this:

image

You need to say if you need just the date or timestamp, name it as “Date” and set the information as I told before.

The result will be that:

image

As a row information, you can use it inside the rule engine AS IT:

MISSING $Date$ => $${SDate&Time}$$
TRUE => $Date$

Standing at this print:

The result:

image

If you see, my date is a date&time timestamp, so appears as full information. If you need just the date, you have to change it at the “Create Date&time rage” node.

KNIME_project-date_time_range.knwf (19.6 KB)

I hope that it help you…

BR, Denis

1 Like

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