<?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: Field Calculator — Sort values, grouped by GROUP_ID field in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/field-calculator-sort-values-partitioned-by-group/m-p/1526038#M87347</link>
    <description>&lt;P&gt;I’m inexperienced with Python, so I assumed a field calculation would be easiest. I hadn’t considered a Python cursor script in the Python Window as an option. But if that’s easier, then it would be fine.&lt;/P&gt;</description>
    <pubDate>Thu, 22 Aug 2024 18:31:51 GMT</pubDate>
    <dc:creator>Bud</dc:creator>
    <dc:date>2024-08-22T18:31:51Z</dc:date>
    <item>
      <title>Field Calculator — Sort values, partitioned by GROUP_ID field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/field-calculator-sort-values-partitioned-by-group/m-p/1525981#M87334</link>
      <description>&lt;P&gt;ArcGIS Pro 3.3.1; file geodatabase&lt;/P&gt;&lt;PRE&gt;GROUP_ID VALUES &lt;BR /&gt;1        &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;1        &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;1        &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;0&lt;BR /&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;2        0&lt;BR /&gt;2        0&lt;BR /&gt;&lt;BR /&gt;3        &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;3        &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;3        &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;1 &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;I want to rearrange the VALUES data so that the values are sorted descending, sorted within each GROUP_ID partition.&lt;/P&gt;&lt;PRE&gt;GROUP_ID VALUES &lt;BR /&gt;1        &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;1        &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;1        &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;0&lt;BR /&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;2        0&lt;BR /&gt;2        0&lt;BR /&gt;&lt;BR /&gt;3        &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;3        &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;3        &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;How can I do that using the Field Calculator?&lt;/P&gt;&lt;P&gt;I’m aware of the Sort geoprocessing tool. But I don’t want to use Sort because it outputs a separate FC. I want to update the original FC directly. And I would prefer not to use the Sort tool, join it back to the original FC, and then do a filed calculation to bring in the joined/sorted values.&lt;/P&gt;&lt;P&gt;I don’t want to sort the rows, I want to edit the values and leave the row order as-is.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2024 01:25:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/field-calculator-sort-values-partitioned-by-group/m-p/1525981#M87334</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2024-08-23T01:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator — Sort values, grouped by GROUP_ID field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/field-calculator-sort-values-partitioned-by-group/m-p/1525998#M87335</link>
      <description>&lt;P&gt;Why does it have to be Calculate Field?&amp;nbsp; This is much more straight-forward with cursors.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2024 18:00:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/field-calculator-sort-values-partitioned-by-group/m-p/1525998#M87335</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2024-08-22T18:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator — Sort values, grouped by GROUP_ID field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/field-calculator-sort-values-partitioned-by-group/m-p/1526038#M87347</link>
      <description>&lt;P&gt;I’m inexperienced with Python, so I assumed a field calculation would be easiest. I hadn’t considered a Python cursor script in the Python Window as an option. But if that’s easier, then it would be fine.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2024 18:31:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/field-calculator-sort-values-partitioned-by-group/m-p/1526038#M87347</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2024-08-22T18:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator — Sort values, grouped by GROUP_ID field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/field-calculator-sort-values-partitioned-by-group/m-p/1526074#M87354</link>
      <description>&lt;P&gt;With Calculate Field, there is no way to ensure row order, truly ensure it.&amp;nbsp; So, doing order-dependent row operations is kludgy at best and generally error prone.&amp;nbsp; With cursors, you can specify an ORDER BY statement to ensure row order, or you can loop through a cursor twice using a dictionary to store and update values.&amp;nbsp; If someone else doesn't offer up some code, I will take a look in a day or so.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2024 19:06:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/field-calculator-sort-values-partitioned-by-group/m-p/1526074#M87354</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2024-08-22T19:06:12Z</dc:date>
    </item>
  </channel>
</rss>

