-
1. Re: What will be the workflow to extract numbers from Character field.(Using functions in Set Fields.)
LJ LongWingFeb 22, 2019 8:31 AM (in response to chakor kawale)
1 of 1 people found this helpfulwow....never tried that before....I would say it's something like use a combination of substr and strstr to walk through each character of a field copying it to a new field, then, have workflow that has a run-if similar to 'field' = [0-9].....and if it passes, copy that character somewhere else, if not, don't...
I've never done anything quite like that before, and the syntax I suggested above might not be 100% right....but it should work fairly similar to that.
-
2. Re: What will be the workflow to extract numbers from Character field.(Using functions in Set Fields.)
Mark WaltersFeb 22, 2019 8:42 AM (in response to chakor kawale)
2 of 2 people found this helpfulSounds like a job for the regex filter API plugin?
-
3. Re: What will be the workflow to extract numbers from Character field.(Using functions in Set Fields.)
LJ LongWingFeb 22, 2019 8:52 AM (in response to Mark Walters)
good point....I often forget about that powerful option.
-
4. Re: What will be the workflow to extract numbers from Character field.(Using functions in Set Fields.)
Jim Bruce Feb 23, 2019 7:45 PM (in response to chakor kawale)1 of 1 people found this helpfulI suggest using the capabilities that the DBMS provides by creating a custom function, digitsOnly(inString) --> digitString
On Oracle, this would use the built-in translate function and return the digitString of 0-9.
For SQL server, the implementation would differ slightly.
Or use a series of AR functions (brute-force method):
- UPPER(inString)
- REPLACE(inString, "A", $NULL$)
- REPLACE(inString, "B", $NULL$)
- ...
- REPLACE(inString, "Z", $NULL$)
-Jim
-
5. Re: What will be the workflow to extract numbers from Character field.(Using functions in Set Fields.)
Marie JohnsonFeb 24, 2019 11:46 AM (in response to chakor kawale)
1 of 1 people found this helpfulChakor
with the action set field you can use direct sql. I’d write an sql that does a patindex something like:
select [field] from [table.view] where PATINDEX('%[ ~`!@#$%^&*_()=+\|{};",<>/?a-z]%', [field])=0
and return that result to your field.
-
6. Re: What will be the workflow to extract numbers from Character field.(Using functions in Set Fields.)
Ganesh GoreMar 25, 2019 1:46 AM (in response to Mark Walters)
I would use REGEX in this particular case.
-
7. Re: What will be the workflow to extract numbers from Character field.(Using functions in Set Fields.)
Marie JohnsonApr 9, 2019 2:39 PM (in response to Marie Johnson)
Just found some of my old code and here’s what I did
created a set field ran this sql
SELECT REGEXP_REPLACE('$Remedy Field$', '[^0-9]', '') FROM ViewName
then your set field would equal $1$ which is the value returned from the direct sql.