<?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: calculation within an IF statement in arcGIS Pro in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/calculation-within-an-if-statement-in-arcgis-pro/m-p/241377#M10575</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure what the calculation is then.. maybe show a sample couple of rows because there is no way you are going to get that formula in each row.&lt;/P&gt;&lt;P&gt;I suspect that your calculation is (Qs*Ls)/Ls … without the 'sum' thing.&lt;/P&gt;&lt;P&gt;You need to clarify why a sum is needed in any event&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Aug 2018 12:29:06 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2018-08-13T12:29:06Z</dc:date>
    <item>
      <title>calculation within an IF statement in arcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculation-within-an-if-statement-in-arcgis-pro/m-p/241368#M10566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'll begin by stating I am very new to the python world!&amp;nbsp;&lt;/P&gt;&lt;P&gt;My problem is this....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to&amp;nbsp;use field calculator in ArcGIS Pro to return a calculation of values in other fields based on an if statement, if that makes sense! Not sure if it can be done?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Calculation is&amp;nbsp;&lt;/P&gt;&lt;P&gt;Qrp=Sum(Qs*Ls)/SumLs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically thus;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;weightAADT(!rp!,!Qs!,!Ls!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code Block&lt;/P&gt;&lt;P&gt;def weightAADT(rp, Qs, Ls):&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;if rp=="Urban Two Lane":&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return &lt;SPAN style="font-size: 12.0pt; color: black;"&gt;sum(Qs * Ls) / &lt;/SPAN&gt;sum(Ls)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my error is "TypeError: 'float' object is not iterable"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help appreciated &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2018 15:24:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculation-within-an-if-statement-in-arcgis-pro/m-p/241368#M10566</guid>
      <dc:creator>MáireDolan</dc:creator>
      <dc:date>2018-08-10T15:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: calculation within an IF statement in arcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculation-within-an-if-statement-in-arcgis-pro/m-p/241369#M10567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would assume that the problem is you're giving the sum built-in function a single number when it expects a collection of numbers.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://docs.python.org/3/library/functions.html#sum" title="https://docs.python.org/3/library/functions.html#sum"&gt;2. Built-in Functions — Python 3.7.0 documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;CODE class="" style="background-color: transparent; font-weight: bold; font-size: 19.2px; padding: 0px 1px;"&gt;sum&lt;/CODE&gt;&lt;SPAN class="" style="font-size: larger;"&gt;(&lt;/SPAN&gt;&lt;EM&gt;iterable&lt;/EM&gt;&lt;SPAN class="" style="font-size: 1.3em;"&gt;[&lt;/SPAN&gt;,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;start&lt;/EM&gt;&lt;SPAN class="" style="font-size: 1.3em;"&gt;]&lt;/SPAN&gt;&lt;SPAN class="" style="font-size: larger;"&gt;)&lt;/SPAN&gt;&lt;A href="https://docs.python.org/3/library/functions.html#sum" style="color: #6363bb; text-decoration: none; font-size: 0.8em; padding: 0px 4px;" title="Permalink to this definition"&gt;https://docs.python.org/3/library/functions.html#sum&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Sums&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;start&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and the items of an&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;iterable&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;from left to right and returns the total.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;start&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;defaults to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="" style="background-color: #ecf0f3; font-size: 15.44px; padding: 0px 1px;"&gt;&lt;SPAN class=""&gt;0&lt;/SPAN&gt;&lt;/CODE&gt;. The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;iterable&lt;/EM&gt;’s items are normally numbers, and the start value is not allowed to be a string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are your values Qs and Ls single float values or are they a collection of numbers?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2018 16:24:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculation-within-an-if-statement-in-arcgis-pro/m-p/241369#M10567</guid>
      <dc:creator>FreddieGibson</dc:creator>
      <dc:date>2018-08-10T16:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: calculation within an IF statement in arcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculation-within-an-if-statement-in-arcgis-pro/m-p/241370#M10568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The field calculator does one record/row at a time, hence your error as Freddie says.&lt;/P&gt;&lt;P&gt;If you want to vectorize your calculations, you need to use numpy with arcpy's TableToNumPyArray to get the field values into an array format, then arcpy.da.ExtendTable to append the result column onto the original table. Otherwise dump the sum as the error indicates&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2018 16:34:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculation-within-an-if-statement-in-arcgis-pro/m-p/241370#M10568</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-08-10T16:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: calculation within an IF statement in arcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculation-within-an-if-statement-in-arcgis-pro/m-p/241371#M10569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Freddie, that makes sense.&lt;/P&gt;&lt;P&gt;Qs &amp;amp; Ls values are indeed single float values. What I was trying to achieve was to sum the calculation/values for each row containing the value of the if statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2018 09:18:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculation-within-an-if-statement-in-arcgis-pro/m-p/241371#M10569</guid>
      <dc:creator>MáireDolan</dc:creator>
      <dc:date>2018-08-13T09:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: calculation within an IF statement in arcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculation-within-an-if-statement-in-arcgis-pro/m-p/241372#M10570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dan,&lt;/P&gt;&lt;P&gt;I've never used numpy, could you give me an example of its use?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2018 09:19:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculation-within-an-if-statement-in-arcgis-pro/m-p/241372#M10570</guid>
      <dc:creator>MáireDolan</dc:creator>
      <dc:date>2018-08-13T09:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: calculation within an IF statement in arcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculation-within-an-if-statement-in-arcgis-pro/m-p/241373#M10571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If each row contains a Qs and an Ls value, then you can calculate&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: transparent; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; color: #000000; font-family: arial,helvetica,&amp;amp;quot; helvetica neue&amp;amp;quot;,verdana,sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; outline-color: invert; outline-style: none; outline-width: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; vertical-align: baseline; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px; border: 0px none #000000;"&gt;Qs * Ls&amp;nbsp; as a field calculation …. nothing more.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: transparent; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; color: #000000; font-family: arial,helvetica,&amp;amp;quot; helvetica neue&amp;amp;quot;,verdana,sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; outline-color: invert; outline-style: none; outline-width: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; vertical-align: baseline; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px; border: 0px none #000000;"&gt;If the final result is supposed to be the sum of all the (Qs*Ls) values&lt;SPAN style="color: #001000;"&gt; divided by the sum of the Ls values as in&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="border-image-slice: 100%; color: #001000; white-space: normal; font-weight: 400; border-image-width: 1; font-size: 16px; background-color: transparent; word-spacing: 0px; text-indent: 0px; helvetica neue&amp;amp;quot: ; font-family: arial,helvetica,&amp;amp;quot; orphans: 2; text-align: left; -webkit-text-stroke-width: 0px; border: 0px none #000000; border-image-source: none; padding: 0px; margin: 0px; border-image-repeat: stretch; letter-spacing: normal; text-decoration: none; vertical-align: baseline; font-style: normal; outline-color: invert; text-transform: none; font-variant: normal; outline-width: 0px; border-image-outset: 0; ,verdana,sans-serif: ; outline-style: none;"&gt;sum(Qs * Ls) / &lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;sum(Ls)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;then you do that final calculation after the fact by doing a field statistics Sum on that product field and the Ls field.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;That equation is a single result which isn't suitable for field calculations&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2018 10:24:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculation-within-an-if-statement-in-arcgis-pro/m-p/241373#M10571</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-08-13T10:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: calculation within an IF statement in arcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculation-within-an-if-statement-in-arcgis-pro/m-p/241374#M10572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dan,&lt;/P&gt;&lt;P&gt;I have done the above, but was trying to see if I could do the same in one step without the statistics table.&lt;/P&gt;&lt;P&gt;Trying to figure out the most efficient way of doing same.&lt;/P&gt;&lt;P&gt;If the statistics table is it, then I'll go with that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2018 10:30:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculation-within-an-if-statement-in-arcgis-pro/m-p/241374#M10572</guid>
      <dc:creator>MáireDolan</dc:creator>
      <dc:date>2018-08-13T10:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: calculation within an IF statement in arcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculation-within-an-if-statement-in-arcgis-pro/m-p/241375#M10573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How do you want to report it?&lt;/P&gt;&lt;P&gt;Are you using a toolbox and just want one number reported?&lt;/P&gt;&lt;P&gt;Do you actually need the Qs*Ls column data at all?&lt;/P&gt;&lt;P&gt;If not, then if would be possible to just produce a small script to get the values in a searchcursor, do the math and spit out the answer.&lt;/P&gt;&lt;P&gt;or use numpy&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;input &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"c:/data/usa.gdb/some_table"&lt;/SPAN&gt;
arr &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;TableToNumPyArray&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;input&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Qs'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Ls'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

qs &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arr&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Qs'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

ls &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arr&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Ls'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# ---- fake data for now&lt;/SPAN&gt;
qs
array&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;6&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;7&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;8&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;9&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

ls
array&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#---- now the math in numpy&lt;/SPAN&gt;

qs_ls_sum &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; np&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;sum&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;qs&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;ls&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

ls_sum &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; np&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;sum&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ls&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; qs_ls_sum&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;ls_sum

result
&lt;SPAN class="number token"&gt;4.666666666666667&lt;/SPAN&gt;
&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;/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;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 12:07:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculation-within-an-if-statement-in-arcgis-pro/m-p/241375#M10573</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T12:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: calculation within an IF statement in arcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculation-within-an-if-statement-in-arcgis-pro/m-p/241376#M10574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need the results as field attributes in the original database. The results are needed for further calculations within that database.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2018 11:01:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculation-within-an-if-statement-in-arcgis-pro/m-p/241376#M10574</guid>
      <dc:creator>MáireDolan</dc:creator>
      <dc:date>2018-08-13T11:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: calculation within an IF statement in arcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculation-within-an-if-statement-in-arcgis-pro/m-p/241377#M10575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure what the calculation is then.. maybe show a sample couple of rows because there is no way you are going to get that formula in each row.&lt;/P&gt;&lt;P&gt;I suspect that your calculation is (Qs*Ls)/Ls … without the 'sum' thing.&lt;/P&gt;&lt;P&gt;You need to clarify why a sum is needed in any event&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2018 12:29:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculation-within-an-if-statement-in-arcgis-pro/m-p/241377#M10575</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-08-13T12:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: calculation within an IF statement in arcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculation-within-an-if-statement-in-arcgis-pro/m-p/241378#M10576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fair enough Dan,&amp;nbsp; I'll try and explain...&lt;/P&gt;&lt;P&gt;I have a database with 525 entries, which I will call 'sites'. Each site has a 'RP' field with 1 of 4 possible attributes, i.e. Urban Two Lane, Rural Two Lane etc.&lt;/P&gt;&lt;P&gt;I need to carry out a calculation, based on the RP attribute, that returns the sum of [Length of site (Ls) * Traffic Flow @ site (Qs)] divided by sum Ls.&lt;/P&gt;&lt;P&gt;So a calculation needs to be applied to each site belonging to a defined RP, before summing up for that RP, if that makes sense.&lt;/P&gt;&lt;P&gt;Below is a very simplified version of fields and attributes contained in said database&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE height="284" style="width: 386px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="width: 64px;"&gt;Site_ID&lt;/TD&gt;&lt;TD style="width: 64px;"&gt;Ls&lt;/TD&gt;&lt;TD style="width: 64px;"&gt;Qs&lt;/TD&gt;&lt;TD style="width: 164px;"&gt;RP&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="width: 64px;"&gt;R125&lt;/TD&gt;&lt;TD style="width: 64px;"&gt;1.25&lt;/TD&gt;&lt;TD style="width: 64px;"&gt;4445&lt;/TD&gt;&lt;TD style="width: 164px;"&gt;Urban Two Lane&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="width: 64px;"&gt;R148&lt;/TD&gt;&lt;TD style="width: 64px;"&gt;0.98&lt;/TD&gt;&lt;TD style="width: 64px;"&gt;8956&lt;/TD&gt;&lt;TD style="width: 164px;"&gt;Rural Two Lane&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="width: 64px;"&gt;R524&lt;/TD&gt;&lt;TD style="width: 64px;"&gt;1.35&lt;/TD&gt;&lt;TD style="width: 64px;"&gt;2350&lt;/TD&gt;&lt;TD style="width: 164px;"&gt;Urban Two Lane&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="width: 64px;"&gt;R385&lt;/TD&gt;&lt;TD style="width: 64px;"&gt;0.88&lt;/TD&gt;&lt;TD style="width: 64px;"&gt;10253&lt;/TD&gt;&lt;TD style="width: 164px;"&gt;Urban Dual Carriageway&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="width: 64px;"&gt;R449&lt;/TD&gt;&lt;TD style="width: 64px;"&gt;1.01&lt;/TD&gt;&lt;TD style="width: 64px;"&gt;15236&lt;/TD&gt;&lt;TD style="width: 164px;"&gt;Rural Dual Carriageway&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="width: 64px;"&gt;R621&lt;/TD&gt;&lt;TD style="width: 64px;"&gt;1.1&lt;/TD&gt;&lt;TD style="width: 64px;"&gt;1052&lt;/TD&gt;&lt;TD style="width: 164px;"&gt;Urban Two Lane&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To be fair Dan I have used the summarise feature followed by a join to get the required result, my query was if there was a better way of doing it in Pro with field calculator alone.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2018 13:19:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculation-within-an-if-statement-in-arcgis-pro/m-p/241378#M10576</guid>
      <dc:creator>MáireDolan</dc:creator>
      <dc:date>2018-08-13T13:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: calculation within an IF statement in arcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculation-within-an-if-statement-in-arcgis-pro/m-p/241379#M10577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;better way... no... only way... yes &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt; …. well, except for doing it in numpy from the start and producing the summary result table directly, but that would be a parallel solution&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2018 13:24:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculation-within-an-if-statement-in-arcgis-pro/m-p/241379#M10577</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-08-13T13:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: calculation within an IF statement in arcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculation-within-an-if-statement-in-arcgis-pro/m-p/241380#M10578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2018 13:32:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculation-within-an-if-statement-in-arcgis-pro/m-p/241380#M10578</guid>
      <dc:creator>MáireDolan</dc:creator>
      <dc:date>2018-08-13T13:32:24Z</dc:date>
    </item>
  </channel>
</rss>

