Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
its_anandrjs

How to clean data

Hi All

I have a data in column and it is not in proper order like "-" is added in the numbers i want to remove that and want only numbers.

So how could i get that pls provide help.

Anand

1 Solution

Accepted Solutions
erichshiino
Partner - Master
Partner - Master

If you just want to remove it,

you can write something like:

purgechar( Field,'-') as Field1

to remove - from your texto

or

left( Field, len(Field)-1) as Field1

to get all the characters at the left (except the last one)

Regards,

Erich

View solution in original post

6 Replies
christian77
Partner - Specialist
Partner - Specialist

Well:

replace(Field,'-','') as Field

If you have something like Barcelona - Real Madrid then use:

subfield(Field,'-',1)            as Field1

subfield(Field,'-',2)            as Field2

erichshiino
Partner - Master
Partner - Master

If you just want to remove it,

you can write something like:

purgechar( Field,'-') as Field1

to remove - from your texto

or

left( Field, len(Field)-1) as Field1

to get all the characters at the left (except the last one)

Regards,

Erich

its_anandrjs
Author

Thanks for that its work.

Regards

Anand

Not applicable

Hi, Do I have to put this in the script file and reload?

erichshiino
Partner - Master
Partner - Master

Yes, that would be part of your load script,

lets say that you code is:

load a, b, c from abc.xls; (just an example.. you actually need more paramenters, right ?)

you can change it to:

load a, b,

purgechar( c,'-') as c

from abc.xls ;

Not applicable

Thanks Erich