Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Cleansing the data

Qlikview gurus

I have the source table as mentioned below

Source table

ID,column1

1    INS

2     INS1

3     INS2

4      INS_id

5      INSUR1

6     INSUR2

Where data has to be clean as follows(removing the extra 1,2 etc things from the keyword like INS and INSUR)

Source table

ID,column1

1     INS

2     INS

3     INS

4     INS

5     INSUR

6     INSUR

Kindly help as I am stuck in between.

1 Solution

Accepted Solutions
Chanty4u
MVP
MVP

try this

Data:

LOAD * INLINE [

ID,column1

1  ,INS

2  ,INS1

3  ,INS2

4  ,INS_id

5  ,INSUR1

6  ,INSUR2

];

Result:

LOAD *,

KeepChar(column1,'ABCDEFGHIJKLMNOPQRSTUVWXYZ') AS Result

Resident Data;

result.PNG

View solution in original post

6 Replies
antoniotiman
Master III
Master III

Hi Kushal,

try

PurgeChar(SubField(column1,'_',1),'0123456789')

Regards,

Antonio

sunny_talwar

I would use a mapping table approach if the number of variations are not too many

Data Cleansing

Chanty4u
MVP
MVP

try this

Data:

LOAD * INLINE [

ID,column1

1  ,INS

2  ,INS1

3  ,INS2

4  ,INS_id

5  ,INSUR1

6  ,INSUR2

];

Result:

LOAD *,

KeepChar(column1,'ABCDEFGHIJKLMNOPQRSTUVWXYZ') AS Result

Resident Data;

result.PNG

Anonymous
Not applicable
Author

Thank you all for your valuable timely inputs.

saimahasan
Partner - Creator III
Partner - Creator III

Use PurgeChar(column1,'0123456789')

engishfaque
Specialist III
Specialist III

Dear Kushal,

Here are the ways to clean your data, for more kindly find attached file.

1. KeepChar Example:

KeepChar(column1,'_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz')as Field_KeepChar

KeepChar(column1,'ABCDEFGHIJKLMNOPQRSTUVWXYZ')as Field_KeepChar


2. PurgeChar Example:

PurgeChar(column1, '0123456789')as Field_PurgeChar


3. Replace Example:

Replace(Replace(column1, '1', ''), '2', '')as Field_Replace

Output:

Output.png

Kind regards,

Ishfaque Ahmed