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: 
amit_saini
Master III
Master III

Seprating numbers out of string help!!!

Hi Folks ,

I'm having below scenario:

Were these KT-PartNo belongs to Plant codes highlighted after # in location filed

What I want to have is output like below , so that I can assign Location codes for KT-PartNo:

Please suggest how to do this???

Thanks,

AS

1 Solution

Accepted Solutions
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Use this:

SubField(right(KeepChar(Location, '#0123456789'), len(KeepChar(Location, '#0123456789'))-1), '#')

Result:

Screenshot_1.jpg

View solution in original post

10 Replies
danansell42
Creator III
Creator III

Have you tried using the subfield function?

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

KeepChar(SubField(Location,'#'), '01234567989') as Location

or maybe

TextBetween(SubField(Location,'#'), '#',' KT') as Location


talk is cheap, supply exceeds demand
amit_saini
Master III
Master III
Author

Thanks Gysbert!

Buy why we are getting blanks:

Thanks,

AS

Not applicable

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

TextBetween(SubField(Mid(Location,Index(Location,'#')+1),'#'), '#',' KT') as Location


talk is cheap, supply exceeds demand
amit_saini
Master III
Master III
Author

Sorry this is not working!

KeepChar(SubField(Location,'#'), '01234567989') as Location is working but showing some blank values

Thanks,

AS

Not applicable

try my method Amit, i think it works in your case!

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Use this:

SubField(right(KeepChar(Location, '#0123456789'), len(KeepChar(Location, '#0123456789'))-1), '#')

Result:

Screenshot_1.jpg

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

SubField takes values from the left.

If there is value like #001#002#003, then the first SubField value that will be returned is a blank value.