<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Assigning Max_DateCreated Value in attribute table to last_update_date field in python script in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/assigning-max-datecreated-value-in-attribute-table/m-p/1324225#M72633</link>
    <description>&lt;P&gt;Your post and screenshots are a little confusing. Do you have only one row in the summary table?&lt;/P&gt;&lt;P&gt;If so, you can do it like this:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;max_date = [row[0] for row in arcpy.da.SearchCursor(BuildCablesMax, ["MAX_DATECREATED"])][0]
arcpy.management.CalculateField(BuildCableLines, "Last_Update_Date", f"'{max_date}'")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If your summary table has multiple rows, you should probably use &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/join-field.htm" target="_blank" rel="noopener"&gt;Join Field&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Thu, 31 Aug 2023 06:10:50 GMT</pubDate>
    <dc:creator>JohannesLindner</dc:creator>
    <dc:date>2023-08-31T06:10:50Z</dc:date>
    <item>
      <title>Assigning Max_DateCreated Value in attribute table to last_update_date field in python script</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/assigning-max-datecreated-value-in-attribute-table/m-p/1323886#M72611</link>
      <description>&lt;P&gt;Hello i am currently running into an issue where i am trying to get a value from a table created from summary statistics into my calculate field expression.&lt;/P&gt;&lt;P&gt;Based on what is in the table i wish to take the MAX_DATECREATED value and assign it to Last_Update_Date field in my python script.&lt;/P&gt;&lt;P&gt;How would i go about achieving pulling thr value located in the table and assigning it specifcally to my calculate field expression?&lt;/P&gt;&lt;P&gt;To give addtional context, the model section of calculate field i am trying to convert into this,&lt;/P&gt;&lt;P&gt;Based on the model, how would i take the value found in my Attribute table from summary statistics and assign to last_update_date the exact value found?&lt;/P&gt;&lt;P&gt;my code is as follows&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Summary Statistics&amp;nbsp;&lt;/P&gt;&lt;P&gt;#Specify output variable&lt;/P&gt;&lt;P&gt;BuildCablesMax = 'Build_Cable_MaxDateCreated'&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#Calculate summary statistics for fields&lt;BR /&gt;arcpy.analysis.Statistics(BuildCableLines, BuildCablesMax, [['DATECREATED', "MAX"]])&lt;/P&gt;&lt;P&gt;#Calculate Field 7&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;arcpy.management.CalculateField(BuildCableLines, "Last_Update_Date", "Last_Update_Date" == )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for the expression i want to assign the value from my BuildCablesMax on MAX_DATECREATED column to my BuildCableLines on Last_Update_Date column equaling this exact value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 13:38:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/assigning-max-datecreated-value-in-attribute-table/m-p/1323886#M72611</guid>
      <dc:creator>Madam</dc:creator>
      <dc:date>2023-08-30T13:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning Max_DateCreated Value in attribute table to last_update_date field in python script</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/assigning-max-datecreated-value-in-attribute-table/m-p/1324225#M72633</link>
      <description>&lt;P&gt;Your post and screenshots are a little confusing. Do you have only one row in the summary table?&lt;/P&gt;&lt;P&gt;If so, you can do it like this:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;max_date = [row[0] for row in arcpy.da.SearchCursor(BuildCablesMax, ["MAX_DATECREATED"])][0]
arcpy.management.CalculateField(BuildCableLines, "Last_Update_Date", f"'{max_date}'")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If your summary table has multiple rows, you should probably use &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/join-field.htm" target="_blank" rel="noopener"&gt;Join Field&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 06:10:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/assigning-max-datecreated-value-in-attribute-table/m-p/1324225#M72633</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-08-31T06:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning Max_DateCreated Value in attribute table to last_update_date field in python script</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/assigning-max-datecreated-value-in-attribute-table/m-p/1324234#M72634</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can confirm this table only has one row in it,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This has now giving me the last_update_date as the same date located in the MAX_DATECREATED column of my table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much.&lt;/P&gt;&lt;P&gt;Have a lovely day!&lt;/P&gt;&lt;P&gt;Madam&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 07:38:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/assigning-max-datecreated-value-in-attribute-table/m-p/1324234#M72634</guid>
      <dc:creator>Madam</dc:creator>
      <dc:date>2023-08-31T07:38:46Z</dc:date>
    </item>
  </channel>
</rss>

