Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Zero at left are being discarted

Hello.

I´m having a problem.

One field of my table has Zeros at left side and althought I´m using "text(myfield) as myfield" in script, Qlikview keeps processing it without the zeros. Eg: Myfield = 00000120. Qlikview show it just like that, with the 5 zeros, but at processing level it does show all article where Myfield end with 120.

Any ideas?

Thanks in advance,

Best Regards,

BS.

1 Solution

Accepted Solutions

Re: Zero at left are being discarted

For data that looks like numbers, QV uses the first string representation it encounters as the display value. If loaded in this order:

01

1

0001

Will all display as "01".

The solution is to use text() function when loading.

text(myfield) as myfield

-Rob

15 Replies
nagaiank
Valued Contributor III

Re: Zero at left are being discarted

Add the following to your script

Set Verbatim = 1;

Not applicable

Re: Zero at left are being discarted

Thanks for your reply but it didn´t work.

From what I´ve had read, verbatim stops the stripping of blanks... not zeros (0)...

BS.

amit_saini
Honored Contributor III

Re: Zero at left are being discarted

Hi Bruno,

Like this???

Please see the attachment!

Thanks,

AS

Not applicable

Re: Zero at left are being discarted

Thanks for your reply.

Yes, my field valus have that format, but I´ve got, for eg. 00000120; 00120; 120, etc... All of that values refer to a product. But Qlikview is showing all products that end with 120. Discarting zeros from its calculations!

BS.

amit_saini
Honored Contributor III

Re: Zero at left are being discarted

You need to  Set Verbatim = 1; at the back end as mentioned below:

Thanks,

AS

ecolomer
Honored Contributor II

Re: Zero at left are being discarted

You can try this:

LET COM=chr(39);

COM&Field&COM as MyField

Not applicable

Re: Zero at left are being discarted

I´ve already did that! But it didn´t solved... It keeps returning 4 products to "myfield = 00000120".

I´m not understanding what its happening, because Qv show myfield with the Zeros!

Re: Zero at left are being discarted

For data that looks like numbers, QV uses the first string representation it encounters as the display value. If loaded in this order:

01

1

0001

Will all display as "01".

The solution is to use text() function when loading.

text(myfield) as myfield

-Rob

Not applicable

Re: Zero at left are being discarted

Not sure what you mean... Sorry...

Community Browser