<?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: calculate field on a joined table with non unique OID in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/calculate-field-on-a-joined-table-with-non-unique/m-p/1015017#M25017</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LeendertBorgers_0-1610113858189.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/3455i61E34B85ED7D18A8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LeendertBorgers_0-1610113858189.png" alt="LeendertBorgers_0-1610113858189.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;here some more examples&lt;/P&gt;</description>
    <pubDate>Fri, 08 Jan 2021 13:51:17 GMT</pubDate>
    <dc:creator>LeendertBorgers</dc:creator>
    <dc:date>2021-01-08T13:51:17Z</dc:date>
    <item>
      <title>calculate field on a joined table with non unique OID</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/calculate-field-on-a-joined-table-with-non-unique/m-p/1015009#M25016</link>
      <description>&lt;P&gt;Hello community,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LeendertBorgers_0-1610110988914.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/3450i9D5E57B08FDA3D99/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LeendertBorgers_0-1610110988914.png" alt="LeendertBorgers_0-1610110988914.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;in the above picture I have joined a feature class with (agricultural) fields with a table with information on what type of soil layers are in those fields. the join worked great in that it gives x amount of layers based on the soil type per field.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LeendertBorgers_1-1610111115503.png" style="width: 605px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/3451i243A389148E4B5BD/image-dimensions/605x64?v=v2" width="605" height="64" role="button" title="LeendertBorgers_1-1610111115503.png" alt="LeendertBorgers_1-1610111115503.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The first OBJECTID* is from the fields class and the second OBJECTID is from the layer table, both are not unique but combined they could be made unique (see below).&lt;/P&gt;&lt;P&gt;now I have to do certain calculations on it but I think because the OBJECTID's aren't unique it just takes one of the values, here is the code I used in the calculate field tool:&lt;/P&gt;&lt;P&gt;&amp;nbsp;def Layerdepth(MEAN_GAG, Diepte_o, Diepte_b):&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (Diepte_o &amp;lt;= MEAN_GAG):&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;depth= Diepte_o-Diepte_b&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return depth&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; elif (Diepte_o&amp;gt;=MEAN_GAG and Diepte_b&amp;lt;=MEAN_GAG):&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;depth= MEAN_GAG-Diepte_b&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return depth&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; elif (Diepte_b&amp;gt;=MEAN_GAG):&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return 0&lt;/P&gt;&lt;P&gt;I need to calculate the depth of each layer but now it just puts one depth at each layer as can be seen in the table above (depth='L).&lt;/P&gt;&lt;P&gt;because I think it is because the OBJECTID's aren't unique I tried creating unique OBJECTID's and then iterate over those. I used this expression for that:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LeendertBorgers_2-1610111440727.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/3452i7BF51097278419CD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LeendertBorgers_2-1610111440727.png" alt="LeendertBorgers_2-1610111440727.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;but then I run into the same problem that it puts the same value at each layer for each field as seen in table above.&lt;/P&gt;&lt;P&gt;Is there anyway I can adjust the code so it does calculate for each layer or a way to make a unique OID for each layer in each field so I can iterate over that?&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Leendert&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 13:18:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/calculate-field-on-a-joined-table-with-non-unique/m-p/1015009#M25016</guid>
      <dc:creator>LeendertBorgers</dc:creator>
      <dc:date>2021-01-08T13:18:08Z</dc:date>
    </item>
    <item>
      <title>Re: calculate field on a joined table with non unique OID</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/calculate-field-on-a-joined-table-with-non-unique/m-p/1015017#M25017</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LeendertBorgers_0-1610113858189.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/3455i61E34B85ED7D18A8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LeendertBorgers_0-1610113858189.png" alt="LeendertBorgers_0-1610113858189.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;here some more examples&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 13:51:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/calculate-field-on-a-joined-table-with-non-unique/m-p/1015017#M25017</guid>
      <dc:creator>LeendertBorgers</dc:creator>
      <dc:date>2021-01-08T13:51:17Z</dc:date>
    </item>
  </channel>
</rss>

