<?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: Select attribute based on minimum value of a different attribute in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/select-attribute-based-on-minimum-value-of-a/m-p/1186652#M56595</link>
    <description>&lt;P&gt;With Arcade:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Create a new integer field&lt;/LI&gt;&lt;LI&gt;Calculate the field, change language to Arcade, use the script below&lt;/LI&gt;&lt;LI&gt;The rows you want have IntegerField = 1. You can use that to eg&lt;UL&gt;&lt;LI&gt;Select Layer By Attribute&lt;/LI&gt;&lt;LI&gt;Query definition&lt;/LI&gt;&lt;LI&gt;Delete all other rows&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;LI-CODE lang="javascript"&gt;var fid = $feature.In_FID
var min_days = Min(Filter($featureset, "In_FID = @fid"), "Days")
return IIF($feature.Days == min_days, 1, 0)&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 27 Jun 2022 09:23:48 GMT</pubDate>
    <dc:creator>JohannesLindner</dc:creator>
    <dc:date>2022-06-27T09:23:48Z</dc:date>
    <item>
      <title>Select attribute based on minimum value of a different attribute</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/select-attribute-based-on-minimum-value-of-a/m-p/1186639#M56593</link>
      <description>&lt;P&gt;I'm working in ArcGISPro 2.9.0 and have a table with 5 fields: ObjectID, In_FID, Dist, Frequency, Days. There are identical values for In_FID (e.g. ten 2s, four 3s, etc) and for each there is a unique number of Days. I need to extract out only the rows which have the lowest Days for each unique In_FID, show these 2 fields and the Dist column. Any ideas please?&lt;/P&gt;&lt;P&gt;I'm also trying it in Python.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Warwick&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 08:36:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/select-attribute-based-on-minimum-value-of-a/m-p/1186639#M56593</guid>
      <dc:creator>WarwickPrewer</dc:creator>
      <dc:date>2022-06-27T08:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: Select attribute based on minimum value of a different attribute</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/select-attribute-based-on-minimum-value-of-a/m-p/1186649#M56594</link>
      <description>&lt;P&gt;With Python:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;backup your table&lt;/LI&gt;&lt;LI&gt;copy/paste the script below, change the table variable, run&lt;/LI&gt;&lt;/UL&gt;&lt;LI-CODE lang="python"&gt;# read table
fields = ["In_FID", "Days"]
table = "table_path_or_layer_name"
table_data = [row for row in arcpy.da.SearchCursor(table, fields)]

# create a dictionary {fid: min(days)}
fids = set([td[0] for td in table_data])  # unique fids
min_days = dict()
for fid in fids:
    days = [td[1] for td in table_data if td[0] == fid]
    min_days[fid] = min(days)

# delete all rows where Days &amp;gt; min(Days[fid])
with arcpy.da.UpdateCursor(table, fields) as cursor:
    for fid, days in cursor:
        if days &amp;gt; min_days[fid]:
            cursor.deleteRow()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 09:17:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/select-attribute-based-on-minimum-value-of-a/m-p/1186649#M56594</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-06-27T09:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: Select attribute based on minimum value of a different attribute</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/select-attribute-based-on-minimum-value-of-a/m-p/1186652#M56595</link>
      <description>&lt;P&gt;With Arcade:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Create a new integer field&lt;/LI&gt;&lt;LI&gt;Calculate the field, change language to Arcade, use the script below&lt;/LI&gt;&lt;LI&gt;The rows you want have IntegerField = 1. You can use that to eg&lt;UL&gt;&lt;LI&gt;Select Layer By Attribute&lt;/LI&gt;&lt;LI&gt;Query definition&lt;/LI&gt;&lt;LI&gt;Delete all other rows&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;LI-CODE lang="javascript"&gt;var fid = $feature.In_FID
var min_days = Min(Filter($featureset, "In_FID = @fid"), "Days")
return IIF($feature.Days == min_days, 1, 0)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 27 Jun 2022 09:23:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/select-attribute-based-on-minimum-value-of-a/m-p/1186652#M56595</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-06-27T09:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: Select attribute based on minimum value of a different attribute</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/select-attribute-based-on-minimum-value-of-a/m-p/1186796#M56609</link>
      <description>&lt;P&gt;Using existing tools:&lt;/P&gt;&lt;P&gt;1. Run Summary Statistics on Days with Minimum option, and specify&amp;nbsp;In_FID as the Case Field.&lt;/P&gt;&lt;P&gt;2. Use Add Join to join the output table with the original table via In_FID or run Join Field to transfer MIN_DAYS via&amp;nbsp;In_FID to the input.&amp;nbsp; Now you should be able to make that selection.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 15:25:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/select-attribute-based-on-minimum-value-of-a/m-p/1186796#M56609</guid>
      <dc:creator>DanLee</dc:creator>
      <dc:date>2022-06-27T15:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: Select attribute based on minimum value of a different attribute</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/select-attribute-based-on-minimum-value-of-a/m-p/1189032#M56890</link>
      <description>&lt;P&gt;Thanks Johannes&lt;/P&gt;&lt;P&gt;Warwick&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jul 2022 07:00:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/select-attribute-based-on-minimum-value-of-a/m-p/1189032#M56890</guid>
      <dc:creator>WarwickPrewer</dc:creator>
      <dc:date>2022-07-03T07:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: Select attribute based on minimum value of a different attribute</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/select-attribute-based-on-minimum-value-of-a/m-p/1189033#M56891</link>
      <description>&lt;P&gt;Thanks DanLee. I tried this but it didn't seem to work. I've sorted it out now. Thanks. Warwick&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jul 2022 07:02:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/select-attribute-based-on-minimum-value-of-a/m-p/1189033#M56891</guid>
      <dc:creator>WarwickPrewer</dc:creator>
      <dc:date>2022-07-03T07:02:12Z</dc:date>
    </item>
  </channel>
</rss>

