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: 
RDhage1644252496
Contributor
Contributor

How to remove unpredictable spaces in column value?

I have requirement where in order to match the names from lookup table to main table, I need to remove spaces from input value.

For ex. Input -"ABC<space><space><space> DGJ"

Lookup value "ABC<space>DGJ"

Some values have 3 spaces between it or some have have 2 spaces between name. How can i eliminate these without using too many replace?

Labels (4)
2 Replies
Anonymous
Not applicable

This should work for you.....

 

row1.columnName.replaceAll(" +", " ")

gjeremy1617088143

Hi, and if you want to keep only one space:

row1.columnName.replaceAll("(?<= ) +","")