<?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: Make CalculatedField with join between feature class and table from gdb in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/make-calculatedfield-with-join-between-feature/m-p/618362#M48247</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hard to tell given your field names, but the calculations can only be made in the file that you are joining to not in the file that you using to join.&amp;nbsp; Try it manually first, to make sure that you have the files in the correct order for the join and hence the file that you can calculate values&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Jun 2017 11:19:58 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2017-06-26T11:19:58Z</dc:date>
    <item>
      <title>Make CalculatedField with join between feature class and table from gdb</title>
      <link>https://community.esri.com/t5/python-questions/make-calculatedfield-with-join-between-feature/m-p/618361#M48246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to make calculatedfield on a field of the feature classe that was joined with a table but does not success.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me to write correctly the expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Set environment settings&lt;BR /&gt;arcpy.env.workspace = r"C:\Users\Folder"&lt;BR /&gt;arcpy.env.qualifiedFieldNames = False&lt;/P&gt;&lt;P&gt;# Set local variables&lt;BR /&gt;inFeatures = r"C:\Users\Folder\Name.gdb\FC"&lt;BR /&gt;layerName = "FC"&lt;BR /&gt;joinTable = r"C:\Users\Folder\Name.gdb\Table_iris_france"&lt;BR /&gt;tableName= "table_iris"&lt;BR /&gt;joinField = "ID"&lt;BR /&gt;joinField2 = "CODE_IRIS"&lt;BR /&gt;field1="POP_COURANT"&lt;/P&gt;&lt;P&gt;# Create a feature layer from the vegtype featureclass&lt;BR /&gt;arcpy.MakeFeatureLayer_management (inFeatures, layerName)&lt;/P&gt;&lt;P&gt;# Make a table view from the table&lt;BR /&gt;arcpy.MakeTableView_management(joinTable, tableName)&lt;/P&gt;&lt;P&gt;# Join the feature layer to a table&lt;BR /&gt;arcpy.AddJoin_management(layerName, joinField, joinTable, joinField2)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# Process: Calculer un champ&lt;BR /&gt;arcpy.CalculateField_management(layerName, "Pop_COURANT", "!"+tableName+".POP_COURANT2!", "PYTHON")&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jun 2017 10:32:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/make-calculatedfield-with-join-between-feature/m-p/618361#M48246</guid>
      <dc:creator>LouisDECOMBE</dc:creator>
      <dc:date>2017-06-26T10:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: Make CalculatedField with join between feature class and table from gdb</title>
      <link>https://community.esri.com/t5/python-questions/make-calculatedfield-with-join-between-feature/m-p/618362#M48247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hard to tell given your field names, but the calculations can only be made in the file that you are joining to not in the file that you using to join.&amp;nbsp; Try it manually first, to make sure that you have the files in the correct order for the join and hence the file that you can calculate values&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jun 2017 11:19:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/make-calculatedfield-with-join-between-feature/m-p/618362#M48247</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-06-26T11:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: Make CalculatedField with join between feature class and table from gdb</title>
      <link>https://community.esri.com/t5/python-questions/make-calculatedfield-with-join-between-feature/m-p/618363#M48248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it works when i did it manually. But as i have more than 50 fields, i wanted to automate it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got error message in this step especially in the name of the field that is in the table joined (not the origine). I do not know how to write it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;# Process: Calculer un champ&lt;/SPAN&gt;&lt;BR style="background-color: #f6f6f6;" /&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;arcpy.CalculateField_management(layerName, "Pop_COURANT", &lt;STRONG&gt;"!"+tableName+".POP_COURANT2!"&lt;/STRONG&gt;, "PYTHON")&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jun 2017 13:12:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/make-calculatedfield-with-join-between-feature/m-p/618363#M48248</guid>
      <dc:creator>LouisDECOMBE</dc:creator>
      <dc:date>2017-06-26T13:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: Make CalculatedField with join between feature class and table from gdb</title>
      <link>https://community.esri.com/t5/python-questions/make-calculatedfield-with-join-between-feature/m-p/618364#M48249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if it worked properly manually, go to your &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/executing-tools/using-the-results-window.htm"&gt;Results output&lt;/A&gt; and check your syntax vs works there.&amp;nbsp; It is a useful option and one that will save a lot of time trying to debug syntax that appears to be correct vs what actually works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jun 2017 13:20:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/make-calculatedfield-with-join-between-feature/m-p/618364#M48249</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-06-26T13:20:07Z</dc:date>
    </item>
  </channel>
</rss>

