Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Value won't Trim

Hello - I'm trying to trim trailing spaces in a field where it contains ID:

Load:

trim([ID])

Value:

70138000000jzWsADM 

for example the above has a space at the end and after the load, the space still exists!

Any help would be greatly appreciated - thank you!

-Jason

1 Solution

Accepted Solutions
Not applicable
Author

This was really close! I used =Ord(Right([ID],1)) and found out the chr was 160 instead of 32 and used

PurgeChar(ID,Chr(160)) as ID

Thanks again Sunny for the speedy response!

-Jason

View solution in original post

7 Replies
tamilarasu

Jason,

Try,

Replace(ID,' ','')


OR


PurgeChar(ID, chr(32) )

sunny_talwar

What about this:

LOAD

PurgeChar(ID, ' '&Chr(32)) as ID

Not applicable
Author

Tried and didn't work - I found out a method in another thread to look for the chr of the space and it is actually a non-breaking space chr160 - so a purgechar worked instead.

Thanks Tamil!

Not applicable
Author

This was really close! I used =Ord(Right([ID],1)) and found out the chr was 160 instead of 32 and used

PurgeChar(ID,Chr(160)) as ID

Thanks again Sunny for the speedy response!

-Jason

View solution in original post

sunny_talwar

Awesome, that was a smart way to determine what the CHR was. I am going to keep that in mind for the future.

If you got what you wanted, please close this thread by marking your answer as correct and any other helpful responses.

Best,

Sunny

Not applicable
Author

Thanks for the reminder! Just marked as correct.

tamilarasu

Glad you found the solution. Usually trim removes any leading and trailing spaces. I suspect something was there other than space and causing the problem. But I didn't thought about the non breaking space at the time.