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

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
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
MVP
MVP

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

=Subfield( string, '-', 1 )

I hope it can helps.

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it

View solution in original post

1 Reply
agigliotti
MVP
MVP

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

=Subfield( string, '-', 1 )

I hope it can helps.

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it