Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
kabibi15
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
lblumenfeld
Partner Ambassador
Partner Ambassador

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
hallquist_nate
Partner - Creator III
Partner - Creator III

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

lblumenfeld
Partner Ambassador
Partner Ambassador

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 

kabibi15
Contributor III
Contributor III
Author

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