Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Data quality

Hi All,

i have a column called name. it contain "firstname midname lastname".

Problem is that spaces between "firstname midname lastname" is not even. e.g. first (two spaces) mindname (one space)lastname.

how to make the spaces even(only one space between "firstname midname lastname")

1 Solution

Accepted Solutions
sunny_talwar

May be this

Replace(name, '  ', ' ') as name

View solution in original post

4 Replies
sunny_talwar

May be this

Replace(name, '  ', ' ') as name

Anonymous
Not applicable
Author

thanks for your reply. already got the same solution 

Anonymous
Not applicable
Author

Hello - you could also try this. 

SubField(Name,'  ',1)&' '&SubField(Name,'  ',2)

vkhassanov
Contributor II
Contributor II

For any number of spaces inside:

Left(name,Index(name,' ')-1) & ' ' & Trim(Mid(name,Index(name,' '),Index(name,' ',-1)-Index(name,' '))) & ' ' & Trim(Right(name,Len(name)-Index(name,' ',-1)))