Hi, I want to convert the latest date of every month into the first date of that particular month.
Can someone help me here please?
Pasting the data here for your ease.
|Current Date Column
||Updated Date Column
Please find below a workflow with a possible solution to your question:
This could be solved in a simpler way using only the -String Manipulation- and the -Lag Column- nodes. However, I’m suggesting this solution here to illustrate how to convert strings into dates and vice-versa too.
Hope it helps.
@aworker awesome solution! Please remind me the string to datetime node requires a specific format right? (E.g. leading zeros, or 4 digits,…)
Sometimes I am a little confused when KNIME is not picking up the date and throws an error. Maybe I should use the node more often ^^
Hi @Daniel_Weikert !
Thanks for your message and compliments !
Indeed but the node has a very nice feature in the configuration menu which most of the time manages to guess the right format. Having said this, it not always succeeds and a bit of help beforehand with a -String Manipulator- node might facilitate a lot its success.
I am not a specialist of “Date & Time” conversion (only a DIYer haha ha). However @takbb did a tremendous and remarkable work on implementing a component which understands most of Data&Time formats:
Thanks a lot @takbb ! Hope it helps
I take this opportunity to wish you @Daniel_Weikert, @Samir_Nagure, @takbb and to all the Knime Forum Community a very Happy New Year !
I was just confused because the node did not want to pick up my 2 digit year so I switched to python node instead ^^
Thanks a lot @aworker to you and all the other valuable contributers as well
I believe the node is not happy with a 2 digits year which I can understand since it is prone to ambiguity and miss-confusion with months and days. I always rather prefer to convert the year to a 4 digits format.
Thanks a lot for your help. It resolved my issue.
Thank you again and Wish You All a Very Happy New Year…
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.