Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to remove leading zeros in table box column?


Hi,

I have a phone number as below in table box.

0064524542444285

+2861244285

How can I change this to 64524542444285  and 2861244285.

can anyone suggest me please?

Thanks.

1 Solution

Accepted Solutions
Not applicable
Author

13 Replies
Not applicable
Author

will purge char works?

sujeetsingh
Master III
Master III

subfield() function will do what you need.

Subfield(Your Field,'+',1) will give you number before +

Subfield(Your Field,'+',2) will give you number after +

Not applicable
Author

Hi Amelia,

Purge would work for the + but not for the leading 0 (as you might have a zero later in the number).

Try something like

Num(PurgeChar([Field1],'+'))

the purge removes the + and then converting to a num will remove the leading 0

hope that helps

Joe

Not applicable
Author

Try this

Not applicable
Author

Thanks,

What if the value is like below

00353 (0) 872686352

when I used Num(PurgeChar([Field1],'+'))  it is showing blank where the value is 00353 (0) 872686352

please suggest me.

Not applicable
Author

Expand the purge to include those extra chars

Num(PurgeChar([Field1],'+()'))

hope that helps

ashfaq_haseeb
Champion III
Champion III

Try this ad let me know if that worked.

Load *,

num(PurgeChar(Replace(Ltrim(replace(Value,0,' ')),' ',0),'+')) as New_Value;

load * Inline [

Value

0064524542444285

+2861244285

];

Regards

ASHFAQ

Not applicable
Author

Thanks.

when I used this it is showing zeros where there are no zero.

actually the value is 87 7737377 but after using replace in the  output it is showing 8707737377

Please suggest me how can I set this?

ashfaq_haseeb
Champion III
Champion III

Can you post few sample line of data.

Regards

ASHFAQ