Hi, I have year-month-day date format but for my activity I only need month-day and to keep it in date format. I have converted it to S format but then it doesn’t let me convert it to date. This in order to be able to subtract the dates.
How do I do it?
Welcome to the forum @Dosuna18
It’s unclear to me what you’re trying to accomplish.
I have year-month-day date format
Where? Is this in a KNIME data format?
I only need month-day and to keep it in date format.
I’m not sure that’s possible.
I have converted it to S format
Why?
then it doesn’t let me convert it to date.
What does this mean exactly?
This in order to be able to subtract the dates.
This seems like a roundabout way of going about things. I’d be trying to use the Date&Time Difference node on the KNIME date columns.
The screenshot doesn’t line up with your description.
What does the starting data look like?
Can you show an example of your desired output?
Would it be acceptable to use the 1st day of each month to turn your month / year column into a complete date? That is certainly easy.
It would allow you to use the date time difference node to subtract dates and get month / year level accuracy. Or you could just split the columns into Mon and year and use an if statement to handle the month calc.
Hi @Dosuna18
If your end goal is to simply subtract the dates, then I recommend you leave your columns as date and then use the ‘Date&Time Difference’ node to compute how much time has elapsed between your dates.
You can use the ‘granularity’ under the output options to specify whether you want the difference to be in days, months, weeks, etc.
I have the approval date which is the first from left to right and the transaction date which is the second, I want to convert those dates to month and day, removing the year. In order to show me transactions starting from the approval date. For example, if the account was approved on 2022-01-28 I want to see the transactions that are made from the 28th of each month regardless of the year.
I have the approval date which is the first from left to right and the transaction date which is the second, I want to convert those dates to month and day, removing the year. In order to show me transactions starting from the approval date. For example, if the account was approved on 2022-01-28 I want to see the transactions that are made from the 28th of each month regardless of the year.
In that case, you don’t need to hold the Date datatype. It is far easier to just extract the month and day values as integers and names for those calcs. You can do it with this node easily.
The other option is to calculate dates for the beginning and ending point of ranges. I typically only do this for more complex variable ranges (like fiscal years since they can change over time and include short periods).
I will try it, thank you
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.