How do I count the number of times a value/string etc. occures in a field (using field calculator)?
In my example I want to count the number of times the letter "H" occures in a field; see attached image.
Use String count:
str.count(sub[, start[, end]]) Return the number of non-overlapping occurrences of substring sub in the range [start, end]. Optional arguments start and end are interpreted as in slice notation.
Example in Field Calculator with Python Parser:
tmp = !BRUKSENHET!.Count('H')