you can use the expression given below.
toString(addMonths(currentDate(),-1),'yyyyMM')
Please note that there is no SubMonths() function. Instead, you need to pass on negative numbers to addMonths().
Hope you got it. Please try and let us know.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have posted a question like below and it has solved.
*I am looking to insert new column into parquet file.
Now, I am tried to do that through data flow and I could insert date column.
But the date column format is not what I thought.
Now format is 'yyyy-mm-dd' and I want to transform it to 'yyyymm'.
I don't know how to do that.
If you have an answer, please tell me that.
Any help would be appreciated.*
But a new problem has occurred.
I have to change the 'MM' part of the date format.
For example, I execute pipeline on 2022-07-05(yyyy-MM-DD), I have to insert date column like '202206'.
I don't know how to solve it.
My expression is:
toInteger(subMonths(currentDate(),-1),'yyyyMM')
But it doesn't work.
Any help would be appreciated.
Thank you.
you can use the expression given below.
toString(addMonths(currentDate(),-1),'yyyyMM')
Please note that there is no SubMonths() function. Instead, you need to pass on negative numbers to addMonths().
Hope you got it. Please try and let us know.