I used pivot table to place dates as individual fields(columns) but pivot table attaches the name of the original
field to each new pivoted column.
There are hundreds of these columns and i need can't change the name one by one.
Solved! Go to Solution.
What do you want to change them to? Is it a matter of slicing up the existing name and using just part of it for the new name? As David Pike suggests, a little more jnfo to your end game would be helpful.
You might consider looping through a list of field names and then use alter fields to make the changes.
I'm unsure of what you want to do exactly.
sorry about that, I guess the best way to describe it is to generate the list of field names and then strip them down to dates only, or at least shorter.
What do you want to change them to? Is it a matter of slicing up the existing name and using just part of it for the new name? As David Pike suggests, a little more jnfo to your end game would be helpful.
You might consider looping through a list of field names and then use alter fields to make the changes.
Thank you Joe, I will test this today. I couldn't remember how to make the list.
You'll need to be careful with the way you end up with a field name. If all you want is the date, for example '1/1/'000' you can easily split the field name at the word 'date' and get the slice you want:
fieldName = 'Monthly_Production_Date1/1/2000'
justTheDate = fieldName.split('Date')[1]
''' justTheDate = '1/1/2000' '''
You've got two things working against you though:
1: Field names can't begin with a number
2: I'm not sure that a field name can contain a special character as a fore slash