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

trim function is not working.Somebody please help me.

I have an account number like 098765432

I want to trim the 0 and want to show 98765432.

I tried , ltrim([Account Number],0)

and also tried         

replace(ltrim(replace([Account Number],'0',' ')),' ','0'))

It is not working.

Which function can I use ?Can u please help me

1 Solution

Accepted Solutions
preminqlik
Specialist II
Specialist II

num(num#([Acount Number]))

View solution in original post

8 Replies
preminqlik
Specialist II
Specialist II

num(num#([Acount Number]))

rbecher
MVP
MVP

Hi,

trim is for blanks only. If the account number has no alpha characters you can just use:

Num([Account Number])

- Ralf

Astrato.io Head of R&D
Not applicable
Author

I am not sure if you have noticed, you have an extra closing bracket

replace(ltrim(replace([Account Number],'0',' ')),' ','0')

rbecher
MVP
MVP

However, replace is dangerous! Because it's not just replacing leading zeros!!

Astrato.io Head of R&D
Not applicable
Author

I have a wildmatch before this.That is the extra closing bracket here.

Not applicable
Author

This is not working.Is there any other way ?

Here is my actual statement

  if(wildmatch([ITEM ID],'L_P_*','BS_*') and if(wildmatch([Account Number],'0*'),num(num#t([Account Number],9))),
  [Account Number]) as InSite_Acct

rbecher
MVP
MVP

..several typos here.

Astrato.io Head of R&D
VishalWaghole
Specialist II
Specialist II

Hi aptha0115,

Hi try this function,

= right(098765432,8)

Hope it will help you.

- Regards,

Vishal Waghole