Split and Count text in a field

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • simonjackson500@gmail.com

    Split and Count text in a field

    I have a field as follows:

    aa_comp
    03, 04, 05
    03, 07, 05, 20
    03, 06, 07

    It is imported from xml (along with other fields), and I am aware of
    multiple values in a field is bad normalisation.

    I need to count of each text occurrence within the whole field column.
    The results would look like:

    03: 3
    04: 1
    05: 2
    06: 1
    07: 2
    20: 1

    The possible values range from 01 to 99.
    The field could contain 0 values or anything up to 99 values
    The delimiter is with a comma.

    Please can someone offer some help?
    I assume I would use split() and count(), but I am not sure how to go
    about
    it.

    Thanks for any help,
    Simon

Working...