Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
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)))