Discussion Board for collaboration on QlikView Scripting.
Hi Everyone !
I need to extract the last word in a field. Does a function exist to do that ?
Go to Solution.
Try this, it returns the last word OK for me.
Data: LOAD subfield(Full_Address, ' ', -1) as LastWord, * INLINE [ Name, Full_Address, James, 3 rue Victor hugo 60100 CREIL, Nick, 6 rue Lucien charton 60160 LAIGNEVILLE, Lena, 9 rue Henri Breuil 60600 CLERMONT, Jenny, 12 rue des frères grimm 60180 NOGENT ];
subfield(YOURFIELD,SubStringCount(YOURFIELD,' ')+1) as LastWord
should do the trick
SubField(Fieldname, ' ', -1) as LastWord
An error appears. It says "inadequate Object memory"
This expression gives me the last letter of the last word
Can you share an example of your input?
LOAD * INLINE [
James, 3 rue Victor hugo 60100 CREIL,
Nick, 6 rue Lucien charton 60160 LAIGNEVILLE,
Lena, 9 rue Henri Breuil 60600 CLERMONT,
Jenny, 12 rue des frères grimm 60180 NOGENT]
I would like to extract the last word of Full_Adress which refers to the town.
I don't know how to join a Qlikview file here
Yup, I don't see why it wouldn't work
I believe Sunny T gave you the correct answer. But you did not code the space between ' '. It will work if you include the space.