Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

Leading zeros are missing in loaded data values

I have loaded data from an excel sheet when I compare the values in the data source with my sheet in qlik sense I'm missing the zeros.

For example: I have a field called ACCOUNT with values 051603 on my reports is only showing 51603. Any help I will really appreciate it.

Thanks.

1 Solution

Accepted Solutions
Highlighted
Luminary
Luminary

In general, whenever you load data that is a code, account number, etc., and that might contain only numbers then it is a best practice to use Text().

Text(fieldname) tells Qlik to always treat the field as text, even if it is only numbers. So, in your load script try:

Load
     Text(ACCOUNT) as ACCOUNT,
     ... rest of load statement.

This also solves some other issues when using visualizations. For example, the ACCOUNT field will always be left-justified.

I hope this is helpful.

Leslie 

View solution in original post

3 Replies
Highlighted
Partner
Partner

This one is always a bit tricky, I find.  Excel is not a great source, so you may need to play around with this a bit.

First, I like to make sure that Excel column is formatted to text.  Once that is done, I use a Text(FIELD) function in the Qlik Scripting to try and force the field into text, and retain leading zeros.  If that still doesn't work, let us know and we'll give you a hand. 

Also, it is helpful to know what you have already tried, so we don't give you options that already are not working.

 

Good luck,

Nate

Highlighted
Luminary
Luminary

In general, whenever you load data that is a code, account number, etc., and that might contain only numbers then it is a best practice to use Text().

Text(fieldname) tells Qlik to always treat the field as text, even if it is only numbers. So, in your load script try:

Load
     Text(ACCOUNT) as ACCOUNT,
     ... rest of load statement.

This also solves some other issues when using visualizations. For example, the ACCOUNT field will always be left-justified.

I hope this is helpful.

Leslie 

View solution in original post

Highlighted
Contributor III
Contributor III

Your proposed solution help solve the problem. Thanks a million time.