<?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: Count Values in Concatenated field for each record !!!! HELP in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/count-values-in-concatenated-field-for-each-record/m-p/1021483#M36589</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/413144"&gt;@HussainMalik1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Would it be possible to share a sample of your data? This would help to write a snippet of code to show how you can do this.&lt;/P&gt;</description>
    <pubDate>Fri, 29 Jan 2021 13:39:10 GMT</pubDate>
    <dc:creator>XanderBakker</dc:creator>
    <dc:date>2021-01-29T13:39:10Z</dc:date>
    <item>
      <title>Count Values in Concatenated field for each record !!!! HELP</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/count-values-in-concatenated-field-for-each-record/m-p/1021325#M36563</link>
      <description>&lt;P&gt;Hello All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/6246"&gt;@ShitijMehta&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/215600"&gt;@DanPatterson&lt;/a&gt;,&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1108"&gt;@XanderBakker&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2538"&gt;@Robert_LeClair&lt;/a&gt;&amp;nbsp;&amp;nbsp;@Anonymous User&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a polygon feature class of buildings in the city, one of the fields in it is ARCHTYPE and it’s a multivalue concatenated field as shown in the image. (NOTE: There are total of 25 Archetype in my data)&lt;/P&gt;&lt;P&gt;So, I want to count the occurrence of each archetype (values are separated by semi colon) in a row and create 25 new fields with the archetype names and update those new fields with the count number.&lt;/P&gt;&lt;P&gt;So, for example Structure_ID 1400232 &lt;STRONG&gt;(2ND HIGHLIGHTED ROW)&lt;/STRONG&gt; I would have 2 new fields called &lt;STRONG&gt;Small Multiplex&amp;lt;2007&lt;/STRONG&gt; and &lt;STRONG&gt;Large Multiplex built &amp;lt; 2007&lt;/STRONG&gt; It should give me value of 4 for and 1 respectively.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The table below is something that i am trying to do counting the each value in Archetype Field and updating the preexisting fields with there respective numbers&lt;/P&gt;&lt;TABLE width="1138"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="63px" height="91px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="253px" height="91px"&gt;&lt;FONT color="#FF0000"&gt;ARCHETYPE&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="94px" height="91px"&gt;Small Multiplex built &amp;lt; 2007&lt;/TD&gt;&lt;TD width="102px" height="91px"&gt;Large Multiplex built &amp;lt; 2007&lt;/TD&gt;&lt;TD width="77px" height="91px"&gt;Archtyp3&lt;/TD&gt;&lt;TD width="77px" height="91px"&gt;Archtyp4&lt;/TD&gt;&lt;TD width="77px" height="91px"&gt;Archtyp5&lt;/TD&gt;&lt;TD width="77px" height="91px"&gt;Archtyp6&lt;/TD&gt;&lt;TD width="77px" height="91px"&gt;Archtyp7&lt;/TD&gt;&lt;TD width="77px" height="91px"&gt;Archtyp8&lt;/TD&gt;&lt;TD width="77px" height="91px"&gt;Archtyp9&lt;/TD&gt;&lt;TD width="86px" height="91px"&gt;Archtyp10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="63px" height="333px"&gt;&lt;FONT color="#FF0000"&gt;Record 1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="253px" height="333px"&gt;&lt;FONT color="#FF0000"&gt;Small Multiplex built &amp;lt; 2007;Small Multiplex built &amp;lt; 2007;Small Multiplex built &amp;lt; 2007;Small Multiplex built &amp;lt; 2007;Small Multiplex built &amp;lt; 2007;Small Multiplex built &amp;lt; 2007;Small Multiplex built &amp;lt; 2007;Small Multiplex built &amp;lt; 2007;Large Multiplex built &amp;lt; 2007;Large Multiplex built &amp;lt; 2007;Large Multiplex built &amp;lt; 2007;Small Multiplex built &amp;lt; 2007;Small Multiplex built &amp;lt; 2007;Large Multiplex built &amp;lt; 2007&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="94px" height="333px"&gt;10&lt;/TD&gt;&lt;TD width="102px" height="333px"&gt;4&lt;/TD&gt;&lt;TD width="77px" height="333px"&gt;0&lt;/TD&gt;&lt;TD width="77px" height="333px"&gt;0&lt;/TD&gt;&lt;TD width="77px" height="333px"&gt;0&lt;/TD&gt;&lt;TD width="77px" height="333px"&gt;0&lt;/TD&gt;&lt;TD width="77px" height="333px"&gt;0&lt;/TD&gt;&lt;TD width="77px" height="333px"&gt;0&lt;/TD&gt;&lt;TD width="77px" height="333px"&gt;0&lt;/TD&gt;&lt;TD width="86px" height="333px"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It would be a great help if someone help me find a way to do this within modelbuilder since this is one of the intermediately step in my main model so either a geoprocessing tool or a script would go a long way.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance and looking forward for a response.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hussain&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2021 22:41:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/count-values-in-concatenated-field-for-each-record/m-p/1021325#M36563</guid>
      <dc:creator>HussainMalik1</dc:creator>
      <dc:date>2021-01-28T22:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: Count Values in Concatenated field for each record !!!! HELP</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/count-values-in-concatenated-field-for-each-record/m-p/1021483#M36589</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/413144"&gt;@HussainMalik1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Would it be possible to share a sample of your data? This would help to write a snippet of code to show how you can do this.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2021 13:39:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/count-values-in-concatenated-field-for-each-record/m-p/1021483#M36589</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-01-29T13:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: Count Values in Concatenated field for each record !!!! HELP</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/count-values-in-concatenated-field-for-each-record/m-p/1021536#M36597</link>
      <description>&lt;P&gt;Hussain - thx for the tag.&amp;nbsp; Agree with Xander that a sample of the data would be useful to figure this one out.&amp;nbsp; I'll defer to Xander's snippet of code to solve this one.&amp;nbsp; All the best!&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2021 15:42:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/count-values-in-concatenated-field-for-each-record/m-p/1021536#M36597</guid>
      <dc:creator>Robert_LeClair</dc:creator>
      <dc:date>2021-01-29T15:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: Count Values in Concatenated field for each record !!!! HELP</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/count-values-in-concatenated-field-for-each-record/m-p/1021681#M36628</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1108"&gt;@XanderBakker&lt;/a&gt;&amp;nbsp;&amp;nbsp;Thanks for getting back to me, really appreciate it, and yes i can share a sample dataset that you can download from my one drive, if you could share your email i could email you the link for my one drive.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hussain&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2021 19:06:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/count-values-in-concatenated-field-for-each-record/m-p/1021681#M36628</guid>
      <dc:creator>HussainMalik1</dc:creator>
      <dc:date>2021-01-29T19:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: Count Values in Concatenated field for each record !!!! HELP</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/count-values-in-concatenated-field-for-each-record/m-p/1021697#M36631</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/413144"&gt;@HussainMalik1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can use a direct message here inside GeoNet or mail me using "xbakker [at] esri.co" (and yes it is "co" for Colombia).&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2021 19:25:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/count-values-in-concatenated-field-for-each-record/m-p/1021697#M36631</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-01-29T19:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Count Values in Concatenated field for each record !!!! HELP</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/count-values-in-concatenated-field-for-each-record/m-p/1021785#M36651</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/413144"&gt;@HussainMalik1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See below the script that allows you to get the statistics:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

def main():
    # read the input featureclass
    # fc = arcpy.GetParameterAsText(0)
    fc = r'D:\GeoNet\ExtractText\XanderBakker.gdb\Hussain_Data_ConcatenatedFieldValueCount'

    # input data field
    fld_name = 'ARCHETYPE'

    # define how the items relate to the fields
    dct_flds = {'Large Multi-Storey Home built &amp;lt; 2007': 'LMSHBLT2007',
                'Large Multi-Storey Home built &amp;gt;= 2007': 'LMSHBGE2007',
                'Large Multiplex built &amp;lt; 2007': 'LMBLT2007',
                'Large Multiplex built &amp;gt;= 2007': 'LMBGE2007',
                'Large Retail': 'LargeRetail',
                'Large Schools': 'LargeSchools',
                'Large Single Storey Home built &amp;lt; 2007': 'LSSHBLT2007',
                'Large Single Storey Home built &amp;gt;= 2007': 'LSSHBGE2007',
                'Medium Apartments Mixed': 'MediumAptMixed',
                'Medium Offices': 'MediumOffices',
                'Small Apartments Mixed': 'SmallAptMixed',
                'Small Multi-Storey Home built &amp;lt; 2007': 'SMSHMLT2007',
                'Small Multi-Storey Home built &amp;gt;= 2007': 'SMSHBGE2007',
                'Small Multiplex built &amp;lt; 2007': 'SMBLT2007',
                'Small Multiplex built &amp;gt;= 2007': 'SMBGE2007',
                'Small Offices': 'SmallOffices',
                'Small Retail': 'SmallRetail',
                'Small Schools': 'SmallSchools',
                'Small Single Storey Home built &amp;lt; 2007': 'SSSHBLT2007',
                'Small Single Storey Home built &amp;gt;= 2007': 'SSSHBGE2007',
                'UNDEFINED': 'UNDEFINED',
                'Very Small Apartments Mixed': 'VerySmallAptMixed'}

    # add fields if necessary
    addfields = True
    if addfields:
        AddFields(fc, dct_flds)

    # create list of fields
    flds = [fld_name]
    for fld in dct_flds.values():
        flds.append(fld)

    # loop through data
    with arcpy.da.UpdateCursor(fc, flds) as curs:
        for row in curs:
            archetype = row[0]
            # calculate statistics
            dct_cnts = GetStats(archetype, dct_flds)
            # set row stats values
            for fld_name, cnt in dct_cnts.items():
                i = flds.index(fld_name)
                row[i] = cnt
            # write updated row
            curs.updateRow(row)


def AddFields(fc, dct_flds):
    # Add the fields mentioned in the dictionary
    for description, fld_name in dct_flds.items():
        if not FieldExists(fc, fld_name):
            arcpy.AddField_management(fc, fld_name, "LONG")


def FieldExists(fc, fld_name):
    # Check if field exists
    if len(arcpy.ListFields(fc, fld_name)) == 0:
        return False
    else:
        return True


def GetStats(archetype, dct_flds):
    # get the stats from the archetype
    dct_cnts = {}
    archetypes = archetype.split(";")
    for description in archetypes:
        if description in dct_flds:
            fld_name = dct_flds[description]
            if fld_name in dct_cnts:
                dct_cnts[fld_name] += 1
            else:
                dct_cnts[fld_name] = 1
        else:
            # oops, value not defined in dct_flds, report this
            print('{} is not included in dct_flds'.format(description))
            pass
    return dct_cnts


if __name__ == '__main__':
    main()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This script points on line 6 to the data you shared.&amp;nbsp; I noticed that the featureclass did not have any output fields defined, so I added code to add the new fields if they don't exist. Please note that there are a large number of UNDEFINED values in the fields.&lt;/P&gt;&lt;P&gt;Below some statistics of what was found in the data:&lt;/P&gt;&lt;TABLE width="494px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="228px"&gt;&lt;STRONG&gt;Description&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="80px"&gt;&lt;STRONG&gt;Count&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="185px"&gt;&lt;STRONG&gt;Output Field name&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="228px"&gt;Large Multi-Storey Home built &amp;lt; 2007&lt;/TD&gt;&lt;TD width="80px"&gt;272&lt;/TD&gt;&lt;TD width="185px"&gt;LMSHBLT2007&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="228px"&gt;Large Multi-Storey Home built &amp;gt;= 2007&lt;/TD&gt;&lt;TD width="80px"&gt;160&lt;/TD&gt;&lt;TD width="185px"&gt;LMSHBGE2007&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="228px"&gt;Large Multiplex built &amp;lt; 2007&lt;/TD&gt;&lt;TD width="80px"&gt;1708&lt;/TD&gt;&lt;TD width="185px"&gt;LMBLT2007&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="228px"&gt;Large Multiplex built &amp;gt;= 2007&lt;/TD&gt;&lt;TD width="80px"&gt;1548&lt;/TD&gt;&lt;TD width="185px"&gt;LMBGE2007&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="228px"&gt;Large Retail&lt;/TD&gt;&lt;TD width="80px"&gt;60&lt;/TD&gt;&lt;TD width="185px"&gt;LargeRetail&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="228px"&gt;Large Schools&lt;/TD&gt;&lt;TD width="80px"&gt;12&lt;/TD&gt;&lt;TD width="185px"&gt;LargeSchools&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="228px"&gt;Large Single Storey Home built &amp;lt; 2007&lt;/TD&gt;&lt;TD width="80px"&gt;2852&lt;/TD&gt;&lt;TD width="185px"&gt;LSSHBLT2007&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="228px"&gt;Large Single Storey Home built &amp;gt;= 2007&lt;/TD&gt;&lt;TD width="80px"&gt;44&lt;/TD&gt;&lt;TD width="185px"&gt;LSSHBGE2007&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="228px"&gt;Medium Apartments Mixed&lt;/TD&gt;&lt;TD width="80px"&gt;40&lt;/TD&gt;&lt;TD width="185px"&gt;MediumAptMixed&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="228px"&gt;Medium Offices&lt;/TD&gt;&lt;TD width="80px"&gt;8&lt;/TD&gt;&lt;TD width="185px"&gt;MediumOffices&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="228px"&gt;Small Apartments Mixed&lt;/TD&gt;&lt;TD width="80px"&gt;72&lt;/TD&gt;&lt;TD width="185px"&gt;SmallAptMixed&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="228px"&gt;Small Multi-Storey Home built &amp;lt; 2007&lt;/TD&gt;&lt;TD width="80px"&gt;1980&lt;/TD&gt;&lt;TD width="185px"&gt;SMSHMLT2007&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="228px"&gt;Small Multi-Storey Home built &amp;gt;= 2007&lt;/TD&gt;&lt;TD width="80px"&gt;424&lt;/TD&gt;&lt;TD width="185px"&gt;SMSHBGE2007&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="228px"&gt;Small Multiplex built &amp;lt; 2007&lt;/TD&gt;&lt;TD width="80px"&gt;2484&lt;/TD&gt;&lt;TD width="185px"&gt;SMBLT2007&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="228px"&gt;Small Multiplex built &amp;gt;= 2007&lt;/TD&gt;&lt;TD width="80px"&gt;392&lt;/TD&gt;&lt;TD width="185px"&gt;SMBGE2007&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="228px"&gt;Small Offices&lt;/TD&gt;&lt;TD width="80px"&gt;20&lt;/TD&gt;&lt;TD width="185px"&gt;SmallOffices&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="228px"&gt;Small Retail&lt;/TD&gt;&lt;TD width="80px"&gt;132&lt;/TD&gt;&lt;TD width="185px"&gt;SmallRetail&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="228px"&gt;Small Schools&lt;/TD&gt;&lt;TD width="80px"&gt;28&lt;/TD&gt;&lt;TD width="185px"&gt;SmallSchools&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="228px"&gt;Small Single Storey Home built &amp;lt; 2007&lt;/TD&gt;&lt;TD width="80px"&gt;6668&lt;/TD&gt;&lt;TD width="185px"&gt;SSSHBLT2007&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="228px"&gt;Small Single Storey Home built &amp;gt;= 2007&lt;/TD&gt;&lt;TD width="80px"&gt;4&lt;/TD&gt;&lt;TD width="185px"&gt;SSSHBGE2007&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="228px"&gt;UNDEFINED&lt;/TD&gt;&lt;TD width="80px"&gt;552&lt;/TD&gt;&lt;TD width="185px"&gt;UNDEFINED&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="228px"&gt;Very Small Apartments Mixed&lt;/TD&gt;&lt;TD width="80px"&gt;224&lt;/TD&gt;&lt;TD width="185px"&gt;VerySmallAptMixed&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if you have any questions. I will try to send the FGDB by private message (if it fits)...&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2021 22:13:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/count-values-in-concatenated-field-for-each-record/m-p/1021785#M36651</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-01-29T22:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: Count Values in Concatenated field for each record !!!! HELP</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/count-values-in-concatenated-field-for-each-record/m-p/1021827#M36656</link>
      <description>&lt;P&gt;See if this helps&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Horizon_0-1611972299912.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/4955iA4FA54B058AE8EA9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Horizon_0-1611972299912.png" alt="Horizon_0-1611972299912.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from collections import Counter
def x(fc):
    cur = arcpy.da.SearchCursor(fc, field_names="type")
    for row in cur:
        bb=Counter(row[0].split(";"))
    for i in bb.keys():
        arcpy.management.AddField(r'C:&amp;lt;path&amp;gt;\Hussain\Hussain.gdb\H', i, 'LONG')
    with arcpy.da.UpdateCursor(fc, field_names=list(bb.keys())) as cursor:
	    for v in cursor:
		    cursor.updateRow(list(bb.values()))
		    &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jan 2021 02:06:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/count-values-in-concatenated-field-for-each-record/m-p/1021827#M36656</guid>
      <dc:creator>SMehta</dc:creator>
      <dc:date>2021-01-30T02:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: Count Values in Concatenated field for each record !!!! HELP</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/count-values-in-concatenated-field-for-each-record/m-p/1022061#M36688</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/433802"&gt;@SMehta&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This for sharing the idea of using Collections::Counter, which is indeed a great way of splitting a text and get a dictionary with the counts. Kudos for that. However, in your code, I don't see you are handling the creation of the same field twice which I assume should fail and using the description for the field name would also fail since the descriptions are no valid field names.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/413144"&gt;@HussainMalik1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Find below the part of the GetStats function which will now set values to 0 and avoids getting the Null values in the result:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def GetStats(archetype, dct_flds):
    # get the stats from the archetype
    dct_cnts = {}
    for description, fld_name in dct_flds.items():
        dct_cnts[fld_name] = 0
    archetypes = archetype.split(";")
    for description in archetypes:
        if description in dct_flds:
            fld_name = dct_flds[description]
            if fld_name in dct_cnts:
                dct_cnts[fld_name] += 1
            else:
                # this part is no longer required
                dct_cnts[fld_name] = 1
        else:
            # oops, value not defined in dct_flds, report this
            print('{} is not included in dct_flds'.format(description))
            pass
    return dct_cnts&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2021 13:22:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/count-values-in-concatenated-field-for-each-record/m-p/1022061#M36688</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-02-01T13:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: Count Values in Concatenated field for each record !!!! HELP</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/count-values-in-concatenated-field-for-each-record/m-p/1022216#M36712</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1108"&gt;@XanderBakker&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your code it works perfectly now.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Hussain&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2021 18:22:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/count-values-in-concatenated-field-for-each-record/m-p/1022216#M36712</guid>
      <dc:creator>HussainMalik1</dc:creator>
      <dc:date>2021-02-01T18:22:45Z</dc:date>
    </item>
  </channel>
</rss>

