<?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 python expression in Esri Training Questions</title>
    <link>https://community.esri.com/t5/esri-training-questions/python-expression/m-p/831723#M506</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the picture you can see an attribute table of an heat meter. The number of the heat meter is 11250423. The heat status is given monthly. Now I want to make an expression to get the consumption of every month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/507740_pastedImage_67.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in theory I have to do sth like this:&lt;/P&gt;&lt;P&gt;y_(i+1)-y_(i) = consumption&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Month 1 (january): y_(1+1)-y_(1) = consumption of January&lt;/P&gt;&lt;P&gt;Month 2 (feb): y_(2+1)-y_(2) = consumption of February&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;Month 12 (dec): y_(12+1)-y_(12) = consumption of December&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;does anybody know, how to write an expression in arcgis? I want to make a new field to calculate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for helping.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greets from Germany!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Sep 2020 10:02:14 GMT</pubDate>
    <dc:creator>GregorMitzlaff</dc:creator>
    <dc:date>2020-09-22T10:02:14Z</dc:date>
    <item>
      <title>python expression</title>
      <link>https://community.esri.com/t5/esri-training-questions/python-expression/m-p/831723#M506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the picture you can see an attribute table of an heat meter. The number of the heat meter is 11250423. The heat status is given monthly. Now I want to make an expression to get the consumption of every month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/507740_pastedImage_67.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in theory I have to do sth like this:&lt;/P&gt;&lt;P&gt;y_(i+1)-y_(i) = consumption&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Month 1 (january): y_(1+1)-y_(1) = consumption of January&lt;/P&gt;&lt;P&gt;Month 2 (feb): y_(2+1)-y_(2) = consumption of February&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;Month 12 (dec): y_(12+1)-y_(12) = consumption of December&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;does anybody know, how to write an expression in arcgis? I want to make a new field to calculate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for helping.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greets from Germany!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Sep 2020 10:02:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/esri-training-questions/python-expression/m-p/831723#M506</guid>
      <dc:creator>GregorMitzlaff</dc:creator>
      <dc:date>2020-09-22T10:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: python expression</title>
      <link>https://community.esri.com/t5/esri-training-questions/python-expression/m-p/831724#M507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What application/environment are you working in?&amp;nbsp; Is the screenshot an ArcGIS Pro table?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Sep 2020 17:50:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/esri-training-questions/python-expression/m-p/831724#M507</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-09-22T17:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: python expression</title>
      <link>https://community.esri.com/t5/esri-training-questions/python-expression/m-p/831725#M508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Id say order it descending then have a codeblock that gets the value for the row in WAERMEMENGE, stores it then does the calculation in the next row. I've not tested the below, and its been ages since ive done this so it's very likely horrifically wrong, but it may give you an idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;##pre-logic:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;def calculate_stuff(field):&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; global previous_value&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; result = field - previous value&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; previous_value = field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; return result&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;##code window:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;calculate_stuff(!WAERMEMENGE!)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Sep 2020 19:45:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/esri-training-questions/python-expression/m-p/831725#M508</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2020-09-22T19:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: python expression</title>
      <link>https://community.esri.com/t5/esri-training-questions/python-expression/m-p/831726#M509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gregor,&lt;/P&gt;&lt;P&gt;I'm sure what you're trying to accomplish can be done in field calculator. In my experience,&amp;nbsp;the more massaging I have to do with data, the more I want to do it near the source. Usually that's fastest and I find it&amp;nbsp;more transparent. Don't know where you're getting your data. But this would be easy to do in SQL:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;SELECT&lt;/SPAN&gt; month&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Datum&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;AS&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;MONTH&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; year&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Datum&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;AS&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;YEAR&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;SUM&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Wärmemenge&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;AS&lt;/SPAN&gt; TOTAL
&lt;SPAN class="keyword token"&gt;FROM&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;YOUR &lt;SPAN class="keyword token"&gt;DATA&lt;/SPAN&gt; SOURCE&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;GROUP&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;BY&lt;/SPAN&gt; month&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Datum&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; year&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Datum&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;-- ORDER BY [MONTH], [YEAR]&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So&amp;nbsp;admittedly, this may not work in in your situation but if it does and you can create a&amp;nbsp;query layer or database view,&amp;nbsp;I bet it would perform better.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d5156; background-color: #ffffff; font-size: 14px;"&gt;Schöne&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM style="color: #5f6368; background-color: #ffffff; font-weight: bold; font-size: 14px;"&gt;Grüße&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:03:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/esri-training-questions/python-expression/m-p/831726#M509</guid>
      <dc:creator>Arne_Gelfert</dc:creator>
      <dc:date>2021-12-12T10:03:14Z</dc:date>
    </item>
  </channel>
</rss>

