Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
wossenhh
Creator
Creator

Trim function

Hi,

Can anybody help me how to use trim function? The data looks like below:

Department

115 - AMC

220 - BMC
331 - LAN

And the intended results should be with out the numbers and -

AMC

BMC

LAN

Thanks,

Wossen

1 Solution

Accepted Solutions
wossenhh
Creator
Creator
Author

Thanks so much Marco!

View solution in original post

10 Replies
Not applicable

Is that always the format?  if so, you can just use Right(Field,3) as FieldName

MarcoWedel

If there will always be a delimiter like '-' then you could use something like

=Trim(SubField(Department, '-',2))

QlikCommunity_Thread_118124_Pic1.JPG.jpg

regards

Marco

Clever_Anjos
Employee
Employee

PurgeChar(Department,'01234567890 -')

wossenhh
Creator
Creator
Author

Thanks Marco! I can able to use the suggestion if I create table or chart. How about for a listbox?

Thanks,

Wossen

MarcoWedel

you can use this expression in a listbox also.

Just select "expression" instead of a field and copy/paste this expression.

regards

Marco

wossenhh
Creator
Creator
Author

Hi Marco,

It didn't work. I get a result as

115 - AMC  -

220 - BMC  -

331 - LAN  -

instead.

Wossen

MarcoWedel

like this?

QlikCommunity_Thread_118124_Pic2.JPG.jpg

I also attached my qvw

hope it helps

regards

Marco

wossenhh
Creator
Creator
Author

Thanks so much Marco!

MarcoWedel

you're welcome.

please mark this thread as answered if you don't have any further questions.

thanks

regards

Marco