Workflow/global parameters or variables of Date type

Hi All,

I have searched through the forum and asked K AI assistant too, but just want to confirm for sure that KNIME does not support workflow parameters/flow variables of Date type?

For actuarial work we need to have key dates fixed (eg valuation date, date of scheme commencement etc) which are then used throughout the workflow and it helps to have one key area to enter/manage them for each project.

  1. The Variable Creator does not have Date Type in the drop down menu.
  2. I tried to set the date parameters using Table Creator node (by specifying Date Type for the date columns) fed to Table Row to Variable node but the outputted flows variables for date parameters are converted to String Type.

Is there any workaround to have workflow variables as Date Types?

Many thanks

Yusuf

Perhaps the Date&Time configuration node ?

Hi Fabien, thanks but the Date&Time Configuration node also outputs the variable as a String Type (and not Date type as needed).

As a work around to this issue, when I am setting my global variables either (1) through Table Creator –> Table Row to Variable or (2) through Variable Creator, I have created 3 INT types to hold the date’s year, month and date.

Then when I need the “variable” date in an Expression node, I use the make_date function with the above INT variables to have a temporary date within the node.

Though it would really help if KNIME can allow variables of Date and DateTime types.

Best, Yusuf

Hi,
yes you are right, there is no specific date&time data type for variables. But you can just use a string!

And the use it either in a regular “Row Filter”

Or in the more specific data&time-based filter

2 Likes

Hi Andreas, thanks for this trick - this definitely helps me in the data checking/validation part of the project to make sure dates in the data set are within set parameters (variable) dates.

But in the modelling part - where I need the dates as Date Types (eg within the Expression node) it doesn’t help as the functions will not accept String Types for date-based calcs! Eg to calculate all members age as at valuation date (which is a variable being set).

Cheers, Yusuf

In the expression node you need parse the string-variable to a date:

2 Likes

Super Andreas! Thanks so much!

1 Like

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