Hello - Hoping you can help me with a formula. I...
# suiteanalytics
l
Hello - Hoping you can help me with a formula. I want to return the characters after the 'Name: ' in the memo field. Line Memo field = Dinner Merchant: 6062 MCO NATURES TAB Name: Joesph Smith On search want a new field that will bring back: Joesph Smith The number of characters after ‘Name:’ varies. thank you !
m
try
Copy code
substr({memo}, instr({memo}, 'Name:') + 6)
Sorry, that's the saved search formula but they're close. Try this for SuiteQL
Copy code
substr(memo, instr(memo, 'Name:') + 6)
l
@Mike Robbins Thank you !!
d
regex method just because ¯\_(ツ)_/¯
REGEXP_SUBSTR({memo}, 'Name: (.+)', 1, 1, null, 1)
that final parameter is the capturing group/subexpression, in this case the 1st (and only) capturing group
(.*)
If the space after name: isn't always present (like "Name:Joeseph"), then you could use pattern
Name: ?(.+)
If "name" might not be capitalized, you can specify case-insensitive matches (
'i'
instead of
null
)
l
@David B Thank you !