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.
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.
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 <SPAN class="operator token">=</SPAN> <SPAN class="string token">'Monthly_Production_Date1/1/2000'</SPAN> justTheDate <SPAN class="operator token">=</SPAN> fieldName<SPAN class="punctuation token">.</SPAN>split<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Date'</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="string token">''' justTheDate = '1/1/2000' '''</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
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
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.