Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
evansabres
Specialist
Specialist

Trim a field based on characters

I have a field, NAME which has data that appears as Brand-10102019-Campaign.  I want to trim this field in my script to only return the 'Brand' portion of the string. The Brand portion is not a set number of characters so doing left, 5 would not work. How can I achieve an end result of 'Brand' from the string 'Brand-10102019-Campaign'

1 Solution

Accepted Solutions
agigliotti
Partner - Champion
Partner - Champion

Hi,
if you always have the "-" symbol as delimiter you can do as below:

=Subfield( string, '-', 1 )

I hope it can helps.

View solution in original post

1 Reply
agigliotti
Partner - Champion
Partner - Champion

Hi,
if you always have the "-" symbol as delimiter you can do as below:

=Subfield( string, '-', 1 )

I hope it can helps.