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: 
singhcv123
Contributor
Contributor

remove space while concatenating more than 2 fields...

Hi,

TRIM([ Title]) & ' ' & TRIM(Initials) & ' ' &TRIM([ Name])

as per above concatenation we are facing space issue while 1 of the field is missing like Title or Initials.

LIke examle :

Alex D voyger    ---------this is right out come.

but if some one who don;t have either title or initial than coming doule space instead of single spcae.

Like ::::Without title 

'  D cow'

Like :: without intital

"Mr  Tad"         double space between title and name ...

please suggest.

6 Replies
Digvijay_Singh

Use something like this -


TRIM([ Title]) & if(len(Title)>0,' ') & TRIM(Initials) & if(len(Initials)>0,' ')&TRIM([ Name])

tamilarasu
Champion
Champion

Hi Virendra ,

Simply try,


Replace( [ Title] & ' ' & Initials & ' ' & [ Name] , '  ' , ' ' )

jagan
Luminary Alumni
Luminary Alumni

Hi,

Simply use Replace() to convert two spaces to single space like below

Replace([ Title] & ' ' & Initials & ' ' & [ Name] , '  ', '')

Replace([ Title] & ' ' & Initials & ' ' & [ Name] , 'Give double space here', 'Single space')


Regards,

jagan.


avinashelite

try like this

replace(filed1&filed2&filed3,' ','')

Anonymous
Not applicable

Hi, try this:

Trim(Replace(TRIM([ Title]) & ' ' & TRIM(Initials) & ' ' &TRIM([ Name]),'  ',' '))


You will remove start space and double spaces.


Regards!

sunny_talwar

Very Nice jagan‌ and others. Thanks for sharing this