<?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: Feature Class table reporting - value occurrence reporting in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/feature-class-table-reporting-value-occurrence/m-p/1659005#M45781</link>
    <description>&lt;P&gt;Quick and rough implementation; replace "table = poly_selection[0]" with a reference to your own table...&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;''' 
A short script to:
   1. Get the list of fields from a table, 
   2. Iterate every row of the table (using da.SearchCursor)
   3. Use list and dictionary to collect 
      3a. List of fields, dictionary of values, count of occurrences
      3b. Optionally, limit # of unique values to report.
   4. Prints results to the console.
'''

import arcpy

### PREPROCESS FOR LIVING ATLAS
poly = "https://services2.arcgis.com/FiaPA4ga0iQKduv3/arcgis/rest/services/USA_Block_Groups_v1/FeatureServer/0"
poly_layer = arcpy.management.MakeFeatureLayer(poly, "Atlas Census Blocks LayerView")
poly_selection = arcpy.management.SelectLayerByAttribute(
    in_layer_or_view = poly_layer, 
    where_clause     = "COUNTY = '173' And STATE = '37'"
)

### Unique Values, All Fields from Table:
## My Table...
table = poly_selection[0]

## Get the List of Fields from My Table
fields = arcpy.ListFields(table)

## Empty Results:
fields_list    = []  # list
fields_summary = {}  # dictionary

## List of Fields, and a 'Summary' Results Dictionary
for field in fields:
    fields_list.append(field.name)
    fields_summary[field.name] = [field.type, field.length, {}]

print('Found', len(fields_summary), 'fields.')

## Now, try to Collect and Count values for every Field:
with arcpy.da.SearchCursor(table, fields_list) as sCursor:
    for row in sCursor:                             # for each row, 
        
        for index,item in enumerate(fields_list):   # for each field
                value_dict = fields_summary[item][2]               

               
                if len(value_dict) &amp;gt; 100:    ## limit number of unique_values to manage
                    value_dict['MORE VALUES'] = value_dict.get('MORE VALUES', 1) + 1
                else:
                    value_dict[row[index]] = value_dict.get(row[index], 1) + 1                
                
## Print our results:
for key in fields_summary:
    print('Field:',key,'\n', fields_summary[key], '\n')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 20 Oct 2025 13:01:17 GMT</pubDate>
    <dc:creator>D_Atkins</dc:creator>
    <dc:date>2025-10-20T13:01:17Z</dc:date>
    <item>
      <title>Feature Class table reporting - value occurrence reporting</title>
      <link>https://community.esri.com/t5/data-management-questions/feature-class-table-reporting-value-occurrence/m-p/1658879#M45778</link>
      <description>&lt;P&gt;anyone know of a simple way to report the following on an attribute table?&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Field Names&lt;UL&gt;&lt;LI&gt;List of values in the field&lt;UL&gt;&lt;LI&gt;Number of occurrences of each value&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Field Name:&lt;STRONG&gt; Phase Configuration&lt;/STRONG&gt;&lt;UL&gt;&lt;LI&gt;Yellow: 1764&lt;/LI&gt;&lt;LI&gt;Red: 851&lt;/LI&gt;&lt;LI&gt;Blue: 289&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Oct 2025 13:34:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/feature-class-table-reporting-value-occurrence/m-p/1658879#M45778</guid>
      <dc:creator>cmartin_puc</dc:creator>
      <dc:date>2025-10-18T13:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Class table reporting - value occurrence reporting</title>
      <link>https://community.esri.com/t5/data-management-questions/feature-class-table-reporting-value-occurrence/m-p/1658890#M45779</link>
      <description>&lt;P&gt;through model builder with a field iterator calling&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/analysis/summary-statistics.htm" target="_blank"&gt;Summary Statistics (Analysis)—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;with the "count" option&lt;/P&gt;&lt;P&gt;obviously, only for fields of Text type&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/modelbuilder-toolbox/iterate-fields.htm" target="_blank"&gt;Iterate Fields (ModelBuilder)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Or if you want other statistics for interval/ratio data type fields, you could accommodate that as well&lt;/P&gt;</description>
      <pubDate>Sat, 18 Oct 2025 15:59:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/feature-class-table-reporting-value-occurrence/m-p/1658890#M45779</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2025-10-18T15:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Class table reporting - value occurrence reporting</title>
      <link>https://community.esri.com/t5/data-management-questions/feature-class-table-reporting-value-occurrence/m-p/1658958#M45780</link>
      <description>&lt;P&gt;Echoing the comment above from Dan that the Summary Statistics tool would probably be a good starting point.&lt;/P&gt;&lt;P&gt;The graphic on the documentation's help page shows a visual example of how it'd work for your table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The tool will output a table, containing each unique value in the field and the count of how many times this value occurs.&lt;/P&gt;&lt;P&gt;Alternatively, if you wanted to give Python a go a workflow along the lines of the following might be suitable:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Set the path to your feature class&lt;/LI&gt;&lt;LI&gt;Identify field to summarise&lt;/LI&gt;&lt;LI&gt;Read the values&lt;/LI&gt;&lt;LI&gt;Count the occurrences&lt;/LI&gt;&lt;LI&gt;Output the results&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;There is a built in python module called "collections" and within this the "counter" class can be used to count the occurrences of items in a list or iterable.&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Oct 2025 08:01:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/feature-class-table-reporting-value-occurrence/m-p/1658958#M45780</guid>
      <dc:creator>RobertCollins</dc:creator>
      <dc:date>2025-10-20T08:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Class table reporting - value occurrence reporting</title>
      <link>https://community.esri.com/t5/data-management-questions/feature-class-table-reporting-value-occurrence/m-p/1659005#M45781</link>
      <description>&lt;P&gt;Quick and rough implementation; replace "table = poly_selection[0]" with a reference to your own table...&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;''' 
A short script to:
   1. Get the list of fields from a table, 
   2. Iterate every row of the table (using da.SearchCursor)
   3. Use list and dictionary to collect 
      3a. List of fields, dictionary of values, count of occurrences
      3b. Optionally, limit # of unique values to report.
   4. Prints results to the console.
'''

import arcpy

### PREPROCESS FOR LIVING ATLAS
poly = "https://services2.arcgis.com/FiaPA4ga0iQKduv3/arcgis/rest/services/USA_Block_Groups_v1/FeatureServer/0"
poly_layer = arcpy.management.MakeFeatureLayer(poly, "Atlas Census Blocks LayerView")
poly_selection = arcpy.management.SelectLayerByAttribute(
    in_layer_or_view = poly_layer, 
    where_clause     = "COUNTY = '173' And STATE = '37'"
)

### Unique Values, All Fields from Table:
## My Table...
table = poly_selection[0]

## Get the List of Fields from My Table
fields = arcpy.ListFields(table)

## Empty Results:
fields_list    = []  # list
fields_summary = {}  # dictionary

## List of Fields, and a 'Summary' Results Dictionary
for field in fields:
    fields_list.append(field.name)
    fields_summary[field.name] = [field.type, field.length, {}]

print('Found', len(fields_summary), 'fields.')

## Now, try to Collect and Count values for every Field:
with arcpy.da.SearchCursor(table, fields_list) as sCursor:
    for row in sCursor:                             # for each row, 
        
        for index,item in enumerate(fields_list):   # for each field
                value_dict = fields_summary[item][2]               

               
                if len(value_dict) &amp;gt; 100:    ## limit number of unique_values to manage
                    value_dict['MORE VALUES'] = value_dict.get('MORE VALUES', 1) + 1
                else:
                    value_dict[row[index]] = value_dict.get(row[index], 1) + 1                
                
## Print our results:
for key in fields_summary:
    print('Field:',key,'\n', fields_summary[key], '\n')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Oct 2025 13:01:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/feature-class-table-reporting-value-occurrence/m-p/1659005#M45781</guid>
      <dc:creator>D_Atkins</dc:creator>
      <dc:date>2025-10-20T13:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Class table reporting - value occurrence reporting</title>
      <link>https://community.esri.com/t5/data-management-questions/feature-class-table-reporting-value-occurrence/m-p/1662377#M45790</link>
      <description>&lt;P&gt;Depends on how "simple" you want.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One simple way is to load into Pro/ArcMap and symbolize on the Phase Configuration field, then select Show Counts.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RhettZufelt_0-1761865458850.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/142939i980C1BFA7288A017/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RhettZufelt_0-1761865458850.png" alt="RhettZufelt_0-1761865458850.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;</description>
      <pubDate>Thu, 30 Oct 2025 23:04:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/feature-class-table-reporting-value-occurrence/m-p/1662377#M45790</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2025-10-30T23:04:45Z</dc:date>
    </item>
  </channel>
</rss>

