Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone !
I need to extract the last word in a field. Does a function exist to do that ?
Thanks,
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
];
hi
something like
subfield(YOURFIELD,SubStringCount(YOURFIELD,' ')+1) as LastWord
should do the trick
or
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?
Example :
LOAD * INLINE [
Name, Full_Adress,
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
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
];
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.
-Rob