Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I have a lot of strings of different lengths but in same format:
AA12 - ABCD: XXX - SC - IWANTTHISSTRING BB34 - EFGH: YYY - SC - ALSOTHISONE |
Is there a way to retrieve the last piece of these strings? In this case I want "IWANTTHISSTRING" and "ALSOTHISONE" as results.
I have tried TextBetween('SC - ', '') but it does not work with empty-string as second argument... Can I count occurences of "-" maybe?
Thanks
Mikael
Hi Mikael,
you can use SubField(VALUE, '- SC - ', 2) expression, where VALUE contains entire string and with assumption that '- SC - ' appears in the string only once.
Without that assumption put parameter value -1 instead 2; that will always return last substring.
regards
Hi Mikael,
you can use SubField(VALUE, '- SC - ', 2) expression, where VALUE contains entire string and with assumption that '- SC - ' appears in the string only once.
Without that assumption put parameter value -1 instead 2; that will always return last substring.
regards
Hi Mikael,
Is the string you are after, ALWAYS after the 3rd "-" ?
I think I know a way in excel to do this, and therefore logically, a way to do it in QV...
Kind regards,
Rich