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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
evansabres
Specialist
Specialist

Trim a Field

Hello -

I have a field that reads Video 123456: Name of Video

I only want the name of the video. How would I trim the field to only return the video name?

Thank you in advance for your assistance.

Labels (1)
4 Replies
shree909
Partner - Specialist II
Partner - Specialist II

Hi Use the subfield  function

=subfield('Video 123456: Name of Video',':',-1)  to get right most part

=subfield('Video 123456: Name of Video',':',1)   to get the result as Video 12345 (left most value)

please post a sample file .

Thanks

antoinelaviron
Partner - Contributor III
Partner - Contributor III

Hi,

Try this in the script:

Trim( SubField(Field,':',2)) as Name

Best regards,

Antoine

MK_QSL
MVP
MVP

=SubField(YourFieldName,':',2)

or

=SubField(YourFieldName,':',-1)

or

=Mid(YourFieldName, Index(YourFieldName,':')+1)

MarcoWedel
MVP
MVP

Hi,

I guess Manish Kachhia's solution

Mid(YourFieldName, Index(YourFieldName,':')+1)

might work best because it's the only one that doesn't load e.g. "Mission: Impossible" as just "Mission" or "Impossible".



hope this helps


regards


Marco