Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a combination of text and numbers and would like to trim as follows:
Name What should be the result
CRIcecream_W1_160x600_Static CR Ice cream
BeefSausage_W3_300x250 Beef Sausage
Is there any way of doing that? Basically to trim anything after _w* and then to make a space like (CR Ice Cream, Beef Sausage)
Thanks,
Wossen
You do not need to use trim. Just:
subfield([Creative Messsage],'_',1) as Creative1
subfield(Name,'_',1) should do the trick. This however won't add spaces.
The first issue could maybe achieved with
subfield( Name, '_',1) as NewName
But how to add the spaces as spearators? I have no clue, if your Names are not known. If you know possible values, you can try a mapping approach.
I am not sure that there is an easy way to add in spaces in this case.
Thanks all, I tried your suggestion subfield(Name,'_',1) as NewName, however it didn't work.
Are you using the subfield function in your load script or in the app itself?
Hi Jacob,
I did in load script and also tried in Edit expression in the listbox.
Can you post your qvw?
Here is what shows in load script:
Load
[Creative Message],
text ([Creative Message]) as Creative,
Trim(subfield([Creative Message], '_',1)) as Creative1
Do you see anything wrong with the above script Jacob?
You do not need to use trim. Just:
subfield([Creative Messsage],'_',1) as Creative1