<?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 Taking Data from Multiple Fields to Populate a New Field in Esri Tutorials Questions</title>
    <link>https://community.esri.com/t5/esri-tutorials-questions/taking-data-from-multiple-fields-to-populate-a-new/m-p/109448#M31</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am doing a project for a class right now in ArcGIS Pro where we are looking at population density with census data.&amp;nbsp;Looking to map females 25-29 years old that are labeled as other race. The female/age and race are in two seperate fields amongst other gender/age and race fields. I want to be able to populate a new field marking the number of the gender/age and race given above but am not sure how.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I've tried:&lt;/P&gt;&lt;P&gt;expression: OF25_29 = calc(!Other!,!F25_29!)&lt;/P&gt;&lt;P&gt;Code Block:&lt;/P&gt;&lt;P&gt;def calc(arg):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;for !Other! &amp;gt;= 1 and !F25_29! &amp;gt;=1:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;OF25_29 = !Other! + !F25_29!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;for !Other! &amp;lt;1 and !F25_29! &amp;lt; 1:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;OF25_29 = 0&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Nov 2020 18:06:03 GMT</pubDate>
    <dc:creator>kelligrey</dc:creator>
    <dc:date>2020-11-10T18:06:03Z</dc:date>
    <item>
      <title>Taking Data from Multiple Fields to Populate a New Field</title>
      <link>https://community.esri.com/t5/esri-tutorials-questions/taking-data-from-multiple-fields-to-populate-a-new/m-p/109448#M31</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am doing a project for a class right now in ArcGIS Pro where we are looking at population density with census data.&amp;nbsp;Looking to map females 25-29 years old that are labeled as other race. The female/age and race are in two seperate fields amongst other gender/age and race fields. I want to be able to populate a new field marking the number of the gender/age and race given above but am not sure how.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I've tried:&lt;/P&gt;&lt;P&gt;expression: OF25_29 = calc(!Other!,!F25_29!)&lt;/P&gt;&lt;P&gt;Code Block:&lt;/P&gt;&lt;P&gt;def calc(arg):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;for !Other! &amp;gt;= 1 and !F25_29! &amp;gt;=1:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;OF25_29 = !Other! + !F25_29!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;for !Other! &amp;lt;1 and !F25_29! &amp;lt; 1:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;OF25_29 = 0&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2020 18:06:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/esri-tutorials-questions/taking-data-from-multiple-fields-to-populate-a-new/m-p/109448#M31</guid>
      <dc:creator>kelligrey</dc:creator>
      <dc:date>2020-11-10T18:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Taking Data from Multiple Fields to Populate a New Field</title>
      <link>https://community.esri.com/t5/esri-tutorials-questions/taking-data-from-multiple-fields-to-populate-a-new/m-p/109449#M32</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've never done a field calculation in Pro I admit, but unless the syntax has changed quite a bit here's my take on it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ensure the python parser is used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've also added an else to catch where condition 1 and 2 are not met (which I believe is a possibility)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;expression&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: inherit; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;= calc(!Other!, !F25_29!)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;calc&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;field1&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; field2&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; field1 &lt;SPAN class="operator token"&gt;&amp;gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; field2 &lt;SPAN class="operator token"&gt;&amp;gt;=&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; field1 &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; field2
    &lt;SPAN class="keyword token"&gt;elif&lt;/SPAN&gt; field1 &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; field2 &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;9999&lt;/SPAN&gt;
 
    &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; result&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:34:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/esri-tutorials-questions/taking-data-from-multiple-fields-to-populate-a-new/m-p/109449#M32</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2021-12-11T06:34:55Z</dc:date>
    </item>
  </channel>
</rss>

