Date and time change

Hello everyone

I need to know exactly how can I allow on knime to subtract “period or number of days” from today’s date to give me an appended new column with dates in the past

Which nodes and how should I work inside each node exactly that would allow at the end subtracting number of days from today’s date for more than 100 rows

Welcome to the forum.

It would be best if you provided more context for your question. As it stands, you’ll only get general advice such as, “try using the Date&Time Shift node”.

What have you tried so far?

Do you need to generate “today’s date” or is that already in your table?

Do you want to subtract the same number of days for each row?

1 Like

Okay, now I have a column for today’s day and a column for the number of days that need to be subtracted per each

Each item has a different number of days to be subtracted and I am not sure how can I do it

Hello @randadarwish,

as @elsamuel said you need to use Date&Time Shift node to for your task. Under assumption you have today’s date in one column and number of days (positive numbers) to subtract in another one first you need to convert number to be negative using Math Formula node. Then follow it with above mentioned node, define your column with negative values as numerical column and granularity as days.

Give it a try and if any questions feel free to ask. Welcome to KNIME Community!

Br,
Ivan

1 Like

@ipazin and I both recommended the Date&Time Shift node. Its configuration is pretty self-explanatory.

1 Like

I tried your recommendations but it does not allow me to subtract the number of days from today’s date using math formula, other suggestions?

It would be best if you showed us your workflow and sample data so that we can see what you’re actually doing. Otherwise, we’re just going to go around in circles.

1 Like

This forum does not allow sharing photos,
However

I have a column showing today’s date per each code and number of day per each code

For example:

ABC 13/10/2020 44 days
DEF 13/10/2020. 32 days
GHI. 13/10/2020. 16 days

How can using knime node allow subtracting 44 from 13/10/2020 to give me 30/8/2020 and so on for the rest?

Hi @randadarwish

use Date/Time Shift node.

BR

Example
Example2

3 Likes

Hi Randa,

You can actually share photos. You just need to take a screenshot of your workflow first, save it to your PC, then upload it here.

1 Like

Can you please show me the Java snippet configuration as well as the date and time shift node, as I do not see any node in the picture allowing that subtraction occured

Extremely sorry for the inconvenience and thanks alot for your help

After I totally understand this one , it will actually help alot

(How can I download the Java snippet node, located in which category)

The Java snippet does the same as you did with your math Formula. It turns the Days to a negative integer value.

The settings for the Date&Time shift node are shown in the picture below.

BR

1 Like

Sorry for that! Last question what node did you use to have the new date column

Hi @randadarwish
your question was answered in my previous posts. I’ve used the Date&Time shift-Node.

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