Hi Community,
I have a problem with the removing of date columns based on expression.
In this case I want to remove columns not older than 3 months from date time (such as 01-02-2021).
Thanks in advance for your help.
Can you show us what you've tried?
I'd suggest using a dynamic select tool.
Something like this (comments to explain):
NOT(DateTimeDiff(
//I'm assuming these are all last year since that information isn't provided, however, modify this as needed'2020-'+
//this pads the month number in the event of a single digit monthpadleft(
//convert last three characters from month abbrev to month numberDatetimeMonth(DateTimeParse(
//If more than one month in name, grab the most recentright([Name],3)
//convert last three characters from month abbrev to month number,'%b'))
//this pads the month number in the event of a single digit month
,2,'0')
//this sets the date part of the date format to the first of the month+'-01'
,dateTimeToday(),'months')>3)
Also, see the attached workflow.
It is a bigger problem because my data looks like this
Feb (02-2021), Jan (01-2021), Dec (01-2020), Nov (01-2020) etc.
So, when Im trying to remove the 3 newest columns (in this case Feb, Jan, Dec) i cannot do datetime parse because there are different years.
Could you try to modify it to this example?
Thank you!