Skip to main content
Announcements
Global Transformation Awards submissions are open! SUBMIT YOUR STORY
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

"0" before a number field

Hi everybody i have a big issue,

when i load a table from and sql server by qlikview, there is a 0 or two zero sometimes  and sometimes not before the field.

For exemple

Test:

load Client, Purchase

from X$table;

The initial values when i extract the field Client on sql server are:

520

1450

1557

15447

15446

But when i do a load from qlikview the values are:

520 ==> ok

01420 ==> Why?

001557 ==> why ?

15447 ==> ok

00015446 => why?

i try the text(Client) as Client function when i load data but not work.

Thanks a lot all !

9 Replies
Not applicable
Author

Hi Sab,

To remove leading zero's Try like this......

replace(ltrim(replace(MyField,'0',' ')),' ','0') AS MyField

Anonymous
Not applicable
Author

Try num(Client)

Anonymous
Not applicable
Author

you need these zeros or not in qlikview ?

Anonymous
Not applicable
Author

if you need those zeros then use num#() other wise use Num()

Thanks

BKC

simsondevadoss
Partner - Creator III

Use text(Client) in preload

Not applicable
Author

Hi,

You can check in sort tab in properties.

Untitled.png

Not applicable
Author

Thanks for all your anwers but there is something i forgot to say to you..

The field Client is alphanumeric that is to say it can have values like :

520

1450

1557

15447

15446

but

454K564A

26565AG4

GESG44

520

4545

too..

Num is just for numerical field, have you got a solution?

Text not work for several values...

Thanks

Not applicable
Author

Thanks a lot but i want to store theses values so i want a function or other in the script...

Not applicable
Author

replace(ltrim(replace(Client,'0',' ')),' ','0') should work even if your field is alphanumeric. See attached screenshot