Parsing the first numeric value within a text string
I'm looking for some load script code that will allow me to parse an integer value within a text string. All it has to do is start with the first occurrence of an integer (no negative values will appear) and keep reading until it finds the first non-numeric (also no decimals needed). Seems fairly straightforward, but I need it quickly, and, for some reason, I've never quite got the hang of loops in QlikView, despite the fact that I'm able to use them in virtually any other language.
Re: Parsing the first numeric value within a text string
Users have been directed to indicate the number of study sites for each country in a comment field. Initially, they should just enter the number of sites, but then update this with " Selected". There are some outliers, like "48 sites, 12 subjects", but this would require more logic than I want at the moment.
It seems I may be able to just get away with a KeepChar([field-name],'0123456789') for my purposes, then filter out any outlandish values, like the 4812 that would be returned in my example above.
However, if you have an idea for how I can just parse the first numeric value (the 48 from above, not the 12), I'd love to hear it.