A looping script or custom function could count them. If each of these values were stored in a different record, counting them would be simpler.
Though this kind of parsing can be done.
Why isn't this job being done right in the first place?
Why aren't these individual records in a table, rather than being dumped into a text field?
Not sure if this is appropriate for your solution, but if the distinct potential values in your source list are known upfront, you could write a simple looping script that uses the ValueCount function to check for the number of times each of those known values occur in the source list. You might setup a utility field that contained all the potential values, and then loop through your source list to discover the ValueCount for each of the values in the utility field.
The list of values is part of a much larger parsing of a custom web page using the Web Viewer.
I just made made this example to simplify my request for assistance.
I could ask that the web page present the list in an alternative format, but I assumed there would be a way to get the required values without requiring a redesign.
1 of 1 people found this helpful
Just needed to make sure we aren't doing it the hard way by counting values in a list when a set of records is much easier.
One way to get these counts would be to parse the data into a set of related records:
layoutTO::value = CountingTO:;value
with "create" enabled for CountingTO
set variable [$K ; value: $K + 1]
exit loop if [ $K > ValueCount ( $ListOfValues ) ]
set field [LayoutTO::value ; getValue ( $ListOfValues; $K ) ]
set field [CountingTO::Count ; CountingTO::Count + 1 ]
this creates one record for each unique value with the counit in the count field.