Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Change field from "lastname, firstname" to "firstname lastname"

Hi,

I am new to Qlik and trying to change the format of a field. Any help is greatly appreciated as I learn the Qlik expressions.

I have a field that contains names like:               Smith, Ted

I would like to change that field so it reads:        Ted Smith

What is the best expression to use?

Thanks for the help!

4 Replies
Anonymous
Not applicable
Author

trim(subfield(yourfield,',',2))&' '&subfield(yourfield,',',1) as yournewfield

Kushal_Chawda

Capitalize(subfield(trim(Name),',',2)) &' '& Capitalize(subfield(trim(Name),',',1))  as New_Name

parul_mehta
Partner - Creator
Partner - Creator

Check this

LOAD Name,
Capitalize(Name) as Name1,
SubField(Capitalize(Name), ',' , 2)& ' ' & SubField(Capitalize(Name), ',' , 1) as Name2
FROM
[..\Book1_try.xlsx]
(
ooxml, embedded labels, table is Sheet3);

Capitalize will convert the string to First letter as Caps, rest Small

Sub Field to pick up string at position 1, and 2

Please refer to the attached document for string fucntions

Anil_Babu_Samineni

Three helpful for you, Would you close this thread

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful