Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
smilingjohn
Specialist
Specialist

special charecter and blanck

Hi,

I have a field Infection which has the data like this

RESP VIRAL PRF, PCR ***INACT 02/23/16 REFER TO RPPPR

i have to remove the ***  from this ,

And also need to suppress blank values how do i achieve this ?

Iam trying with this below code 

PurgeChar( Infection , '*') and If(Len(Trim(Infection )) > 0, Infection ) asInfection

9 Replies
sunny_talwar

May be try this:

If(Len(Trim(PurgeChar(Infection, '*'))) > 0, PurgeChar(Infection, '*')) as Infection

tamilarasu
Champion
Champion

Try,

If(Len(Trim(Infection )) > 0, PurgeChar(Infection , '*') ) asInfection

smilingjohn
Specialist
Specialist
Author

HI Sunny ,

How do i give the space , i used the above expression it works perfectly , but when i removed *** there has to be space between

sunny_talwar

Try this:

If(Len(Trim(Replace(Infection, '***', ' '))) > 0, Replace(Infection, '***', ' ')) as Infection

smilingjohn
Specialist
Specialist
Author

Its not giving the space

sunny_talwar

It should replace *** with a space

Replace(Infection, '***', ' ')

Is that not working for you?

sunny_talwar

Check out the sample:

Capture.PNG

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Use Replace function:

Replace(Infection, '*', '')

avinashelite

As Sunny suggested it should work with the replace function

Replace(Infection, '***', ' ')


here in the third parameter try to give as much space you want like a tab space you will observe the space getting generated