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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Removing parentheses and dash in a tMap String Expression

Hello,

 

I have input file with telephone numbers in this format (###) ###-####.

 

In the output column I need the telephone to be in this format ##########. (No parentheses dash or spaces)

 

I know how I can remove the parentheses with this function. 

 

row1.phone.replaceAll("\\(", "").replaceAll("\\)","")

 

Can anyone edit this string method so it will remove the dash and space between the area code and the actual number?

 

Thanks,

 

Andrew

 

 

Labels (2)
1 Solution

Accepted Solutions
akumar2301
Specialist II
Specialist II

Try this 

 

row1.input_col.replaceAll("[^\\d\\.\\,\\s]+", "")

View solution in original post

4 Replies
TRF
Champion II
Champion II

This one removes all non-digit characters:

row1.phone.replaceAll("[^0-9]", "")
Anonymous
Not applicable
Author

@TRF 

 

If I wanted to remove $ sign from a Currency value what would be the syntax for that?

 

row1.Amount.replaceALL("$","") is not working for me.

 

I can't use your String Method because it would remove the . separating Dollar and Cents.

 

My input Column has values like $20.00 $100.00 $5.00 etc

 

Thanks,

 

Andrew

Anonymous
Not applicable
Author

@sm  as your requirement is miscellaneous its better we write a java routine and call in the tMap. You can exactly define routine as per your need.

akumar2301
Specialist II
Specialist II

Try this 

 

row1.input_col.replaceAll("[^\\d\\.\\,\\s]+", "")