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: 
Not applicable

How to Trim a value

Hi,

    I Have id value like "0123458....." i want this value "0123458"how to trim this "........." value.

16 Replies
sunilkumarqv
Specialist II
Specialist II

Copy and past this in your script

=PurgeChar( '0123458.....',.) it returs 0123458

preminqlik
Specialist II
Specialist II

replace(fieldname,'.',null())                    as               Newfieldname

ThornOfCrowns
Specialist II
Specialist II

That's a lot of ways to do the same thing! I personally like the KeepChar function.

Not applicable
Author

Thanks to all, I have one more file like,

RT25698-R

ED56248-R

GR78542-S

How to remove the -R and -S value,Please give query.

ThornOfCrowns
Specialist II
Specialist II

=Left(FieldName,7) if your values are all the same length.

preminqlik
Specialist II
Specialist II

here u can use subfield(fieldname,'-',1)

robert99
Specialist III
Specialist III

or if not the same length

left (fieldname,index(fieldname,'-')-1) should work