Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

zeros ?

Hi All,

I have one Column ContractID..

Values:

000238

000567

000786

001234

001435

028978

I want to remove zeros how can i write in back end scripting..

1 Solution

Accepted Solutions
Not applicable

Re: zeros ?

replace(ltrim(replace(ContractID,'0',' ')),' ','0') as ContractID

This was taken from a previous discussion:

Remove Leading Zeros from Field while loading

7 Replies
MVP
MVP

Re: zeros ?

Num(ContractID) as ContractID

Not applicable

Re: zeros ?

replace(ltrim(replace(ContractID,'0',' ')),' ','0') as ContractID

This was taken from a previous discussion:

Remove Leading Zeros from Field while loading

dmohanty
Valued Contributor

Re: zeros ?

Hi,

Use like this below :

 

PurgeChar(ContractID , '0') as NewContractID

OR

 

num(ContractID ) as NewContractID

Re: zeros ?

Hi,

May be like this.

Regards

ASHFAQ

fkeuroglian
Honored Contributor

Re: zeros ?

Hi, try this:

REPLACE(LTRIM(REPLACE(FIELD, '0', ' ')), ' ', '0')as FIELD,

good luck

Fernando

Not applicable

Re: zeros ?

you can use:

num(youFieldName)

it will cut of leading zeros.

regards,

MT

fernando_tonial
Valued Contributor

Re: zeros ?

You try this:

Data:

LOAD Values, Num(Values,'0') AS Values_New INLINE [

    Values

    000238

    000567

    000786

    001234

    001435

    028978

];

Best Regards.

Tonial.

Community Browser