Adding days to a date field


I am trying to add a number of days (shift the date) to a ‘Payment Date’ field. The number of days to add / shift depends on what day of the week the ‘Payment Date’ is. For example if the payment date was a Thursday (day = 5) or a Friday (day = 6), then I would like to add 4 days to the ‘Payment Date’. For all other days I would only like to add 2 days.

An Excel equivalent looks something like this:

Can this be done. Any help would be appreciated.


This is my attempt using the column expression node:

if (column(“Day of week (number)”) == 5)
{if (column(“Day of week (number)”) == 6)
{plusTemporal(column(“Payment Date”),periodOfDays(4) )}
{plusTemporal(column(“Payment Date”),periodOfDays(2) )}}

but it seems to be adding 2 days when the day of week is either 5 or 6, whereas I would like it to add 4.

Not sure where I am going wrong…

Try this.

1 Like

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