I have a group of columns with dates in the following format: 2016.01, 2016.02, 2016.03, etc. What is the easiest way to update the headers of each column to the following format: Jan 2016, Feb 2016, Mar 2016, etc.?
Solved! Go to Solution.
The formula to convert "2016.01" to "Jan 2016" is as follows:
DateTimeFormat(DateTimeParse([_CurrentField_],"%Y.%m"),"%b %Y")
I think a good way to apply that in renaming fields would be to use a Dynamic Rename tools with the following formula:
IF REGEX_Match([_CurrentField_],"\d{4}\.\d{2}") THEN
DateTimeFormat(DateTimeParse([_CurrentField_],"%Y.%m"),"%b %Y")
ELSE [_CurrentField_] ENDIF
That basically says that if the field name is in the format ####.## then apply the date rename. Otherwise, leave the field alone.
Thank you! This is very helpful!
One question - in this case, X, Y, Z represents my entire dataset, but how can I replicate this without having to input my entire dataset? In other words, I want to just drop the new dates into cells F5 through AP5 without impacting the dataset.
Charlie's solution actually may work even better, so you don't need to transpose fields.
I don't think dropping new dates would impact your workflow, if you leave your Transpose Tool with "Dynamic or Unknown Fields" checked.
Thank you both! Charlie's solution worked great.