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

hi

try this

left('0123456789',9)

Not applicable
Author

try this

left('0123458.......',7)

Not applicable
Author

trim(s )

Returns the string s trimmed of any leading and trailing spaces.

Example:

trim ( ' abc' ) returns 'abc'

trim ( 'abc ' ) returns 'abc'

trim ( ' abc ' ) returns 'abc'

KeepChar(s1 , s2)

Returns the string s1 less all characters not contained in string s2.

Example:

keepchar ( 'a1b2c3','123' ) returns '123'

Not applicable
Author

the trim function would remove all spaces. I'm not sure if you ment to remove a period or spaces in your example.

Use Qlikview help to see all 'string functions'

Not applicable
Author

Hi Mani,

Try to this one

Let Lside=LTrim("0123458     ");

hope this will help you

Regards,

DJ

giakoum
Partner - Master II
Partner - Master II

PurgeChar(s1, s2)

Returns the string s1 less all characters contained in string s2.

Example:

purgechar ( 'a1b2c3','123' ) returns 'abc'

so in your case purgechar ( '0123458.....','.' )

MayilVahanan

HI

Try like this

=KeepChar('0123458.....',1234567890) gives number only

or

=PurgeChar('0123458.....','.') gives 0123458

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Sokkorn
Master
Master

Hi Mani,

Use KeepChar( '0123458.....','0123456789' ) -> returns '0123458'

Regards,

Sokkorn

Not applicable
Author

Hi,

=Purgechar( Purgechar( Firldname, ' . ' ), '1''2''3''4')

=PurgeChar(Firldname,0123456789.)

=KeepChar(Firldname,123456789)

Regards,

DJ