Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Mastering Change Data Capture: Read Now
cancel
Showing results for 
Search instead for 
Did you mean: 
muralam
Creator
Creator

Data Cleansing

Hi,

Apologies if it sounds a stupid question. I need to do data cleaning as below

Original Data Transformed Data expected
MAY 1000394 MAY1000394(remove spaces and convert to UpperCase)
MAY 73-4506 MAY73-4506(remove spaces and convert to UpperCase)
MAY v 1915 MAYV1915(remove spaces and convert to UpperCase)
MAY-P8181 MAYP8181(and convert to UpperCase, also remove '-' after MAY)

 

please help out with a solution

 

Regards,

Meena

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Here is the solution in a tMAP

0683p000009LxgG.png

Here is the code: in.originalData.trim().replace(" ","").replace("MAY-","MAY").toUpperCase()

Is that what you need?

 

EDIT: better do this in this way : in.originalData.trim().replace(" ","").toUpperCase().replace("MAY-","MAY")

View solution in original post

3 Replies
iamabhishek
Creator III
Creator III

@muralam - is this the complete data set or these are few samples. The reason to know if the data & the "-" are in fixed positions, or variable.

Anonymous
Not applicable

Here is the solution in a tMAP

0683p000009LxgG.png

Here is the code: in.originalData.trim().replace(" ","").replace("MAY-","MAY").toUpperCase()

Is that what you need?

 

EDIT: better do this in this way : in.originalData.trim().replace(" ","").toUpperCase().replace("MAY-","MAY")

muralam
Creator
Creator
Author

Thanks for your prompt response, its working