Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Use this:
SubField(right(KeepChar(Location, '#0123456789'), len(KeepChar(Location, '#0123456789'))-1), '#')
Result:
Have you tried using the subfield function?
KeepChar(SubField(Location,'#'), '01234567989') as Location
or maybe
TextBetween(SubField(Location,'#'), '#',' KT') as Location
Thanks Gysbert!
Buy why we are getting blanks:
Thanks,
AS
=mid(Location,5,3) is the answer. FYR: https://help.qlik.com/en-US/qlikview/12.0/Subsystems/Client/Content/Scripting/StringFunctions/Mid.ht...
TextBetween(SubField(Mid(Location,Index(Location,'#')+1),'#'), '#',' KT') as Location
Sorry this is not working!
KeepChar(SubField(Location,'#'), '01234567989') as Location is working but showing some blank values
Thanks,
AS
try my method Amit, i think it works in your case!
Use this:
SubField(right(KeepChar(Location, '#0123456789'), len(KeepChar(Location, '#0123456789'))-1), '#')
Result:
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.