<?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: Extract value from expression in ArcMap Questions</title>
    <link>https://community.esri.com/t5/arcmap-questions/extract-value-from-expression/m-p/1118397#M3199</link>
    <description>&lt;P&gt;don't know if it was ported back to arcmap, but&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/analysis/split-by-attributes.htm" target="_blank"&gt;Split By Attributes (Analysis)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;then there may be the issue about output file names.&lt;/P&gt;</description>
    <pubDate>Thu, 18 Nov 2021 20:53:29 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2021-11-18T20:53:29Z</dc:date>
    <item>
      <title>Extract value from expression</title>
      <link>https://community.esri.com/t5/arcmap-questions/extract-value-from-expression/m-p/1118389#M3198</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a SHP with these attributes:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="20%" height="24px"&gt;ID1&lt;/TD&gt;&lt;TD width="20%" height="24px"&gt;NAME1&lt;/TD&gt;&lt;TD width="20%" height="24px"&gt;AREA&lt;/TD&gt;&lt;TD width="20%" height="24px"&gt;ID2&lt;/TD&gt;&lt;TD width="20%" height="24px"&gt;NAME2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="20%" height="24px"&gt;123&lt;/TD&gt;&lt;TD width="20%" height="24px"&gt;John&lt;/TD&gt;&lt;TD width="20%" height="24px"&gt;0,12&lt;/TD&gt;&lt;TD width="20%" height="24px"&gt;135&lt;/TD&gt;&lt;TD width="20%" height="24px"&gt;Lisa&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="20%" height="24px"&gt;123&lt;/TD&gt;&lt;TD width="20%" height="24px"&gt;John&lt;/TD&gt;&lt;TD width="20%" height="24px"&gt;1&lt;/TD&gt;&lt;TD width="20%" height="24px"&gt;246&lt;/TD&gt;&lt;TD width="20%" height="24px"&gt;Veronica&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="20%" height="23px"&gt;456&lt;/TD&gt;&lt;TD width="20%" height="23px"&gt;Kyra&lt;/TD&gt;&lt;TD width="20%" height="23px"&gt;3,2&lt;/TD&gt;&lt;TD width="20%" height="23px"&gt;246&lt;/TD&gt;&lt;TD width="20%" height="23px"&gt;Veronica&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="20%" height="24px"&gt;789&lt;/TD&gt;&lt;TD width="20%" height="24px"&gt;Oliver&lt;/TD&gt;&lt;TD width="20%" height="24px"&gt;4,5&lt;/TD&gt;&lt;TD width="20%" height="24px"&gt;123&lt;/TD&gt;&lt;TD width="20%" height="24px"&gt;John&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="20%" height="24px"&gt;012&lt;/TD&gt;&lt;TD width="20%" height="24px"&gt;Nick&lt;/TD&gt;&lt;TD width="20%" height="24px"&gt;78&lt;/TD&gt;&lt;TD width="20%" height="24px"&gt;123&lt;/TD&gt;&lt;TD width="20%" height="24px"&gt;John&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="20%" height="24px"&gt;012&lt;/TD&gt;&lt;TD width="20%" height="24px"&gt;Nick&lt;/TD&gt;&lt;TD width="20%" height="24px"&gt;8,9&lt;/TD&gt;&lt;TD width="20%" height="24px"&gt;100&lt;/TD&gt;&lt;TD width="20%" height="24px"&gt;Nelson&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Then I need to make an expression based on ID´s - for example for JOHN.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"ID1=123 or ID2=123"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;But then I need to export it as a new SHP but I want it with ID in output name.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So output file would be "Polygons_123"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For another file would be "Polygons_789" and so on....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is there any option how to extract this value from expression and make it through Calculate value maybe? Or is there another way?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 20:41:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/extract-value-from-expression/m-p/1118389#M3198</guid>
      <dc:creator>StanislavaV</dc:creator>
      <dc:date>2021-11-18T20:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: Extract value from expression</title>
      <link>https://community.esri.com/t5/arcmap-questions/extract-value-from-expression/m-p/1118397#M3199</link>
      <description>&lt;P&gt;don't know if it was ported back to arcmap, but&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/analysis/split-by-attributes.htm" target="_blank"&gt;Split By Attributes (Analysis)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;then there may be the issue about output file names.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 20:53:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/extract-value-from-expression/m-p/1118397#M3199</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-11-18T20:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: Extract value from expression</title>
      <link>https://community.esri.com/t5/arcmap-questions/extract-value-from-expression/m-p/1118565#M3200</link>
      <description>&lt;P&gt;Edit and run this code in the python window.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;input_path = "path:/to/your/SHP.shp"
output_path = "path:/to/output/folder_or_gdb"

# get unique values for id1 and id2
raw_ids = [r for r in arcpy.da.SearchCursor(input_path, ["ID1", "ID2"])]
ids = [ri[0] for ri in raw_ids] + [ri[1] for ri in raw_ids]
unique_ids = list(set(ids))

# loop through unique_ids
for uid in unique_ids:
    where_clause = "ID1 = {0} OR ID2 = {0}".format(uid)
    output_name = "Polygons_{}".format(uid)
    arcpy.conversion.FeatureClassToFeatureClass(input_path, output_path, output_name, where_clause)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 19 Nov 2021 07:17:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/extract-value-from-expression/m-p/1118565#M3200</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-11-19T07:17:04Z</dc:date>
    </item>
  </channel>
</rss>

