I have come across this issue recently with the manipulation…
If the number entered is 202201 then it needs to be 01 August 2021 and so on.
If the number is 202206 then the date should be 01 January 2022. I have years in 2020 to 2025 and I do not know how to fix this I have attached date list if anyone can help me with this issue. Thanks in advance. KNIMEHelp.xlsx (10.2 KB)
sorry but I did not get your logic. 202201 is converted to 01 August 2021. Why August? Why 2021?
Also 202206 is converted to 01 January 2022. Why January? Or if it is January why 01 and not 06?
Or this is your task? Assuming that 202201 is equivalent with 01 August 2021, and 202206 is equivalent with 01 January 2022 than your data in your excel are equivalent with what?
Moreover please tell us what have you already done to achieve your goal? Which nodes did you use, with which settings, where did you stuck etc. In this way you make easier to the other Forum user to help you in the right direction moreover it creates an atmosphere we are working together.
Or this is your task? Assuming that 202201 is equivalent with 01 August 2021, and 202206 is equivalent with 01 January 2022 than your data in your excel are equivalent with what?
This is right this is what i have to do convert based on that rule.
As @dora_gcs has pointed out, there’s not enough details to determine what the rule is, and with just 2 sample records, it’s not enough to see a pattern for certain in order to determine the logic.
The only logic that I see in there is that:
If 202201 can be assumed to be January 2022; and
202206 can be assumed to be June 2022
Then the pattern seem to be that the result is 5 months before that date:
202201 - 5 months = August 2021
202206 - 5 months = January 2022
You can use the Date/Time Shift for this
Use string manipulation to convert 202201 to 2022-01-01 and so on.
Convert the result to Date using String to Date node
Use Date/Time Shift to remove 5 months
EDIT: I put something together for you. Something like this will do:
Supplementing the others, please confirm if you made a typo and the months should be equivelant or that a shift needs to apply. Below a way to accomplish the former in case this is your use case:
Since you always want to reflect the starting date of the month as 01, I opt to add this to string input to supplement the date with a Column Expression or String Manipulation.