Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Lost leading zeroes from a text field

Hello,

Has anyone else experienced the same behaviour in a Qlikview 11 / ODBC 6.1.7601 environement ?

We access data thru ODBC (target database being DB2 on AS/400).

In the tabel, a text field FIELD1 can contain the follow values:
0003011601
0003011601
00030116
00030456
etc.

The data are loaded to Qlikview thru the following command:

Load FIELD1 ;
SQL
Select FIELD1
from table ;

Once the data are loaded, some of the leading zeroes are lost:

03011601  (instead of 0003011601)
03011601  (instead of 0003011601)
00030116
00030456

This of course causes data integrity issues.


We have implemented a workaround as follows:


Load      REPLACE(FIELD1, '#','') as FIELD1  ;
SQL
Select  '#' || FIELD1 || '#' as FIELD1
from table;

But we are afraid that this same problem has occurred on other tables and other fields.

If someone else has experienced this behaviour, is there a better workaround ?

Thanks in advance for any help or opinion.

1 Reply
tamilarasu
Champion
Champion

Hi Thierry,

This should work in that case.

Load Text(FIELD1) as FIELD1 ;
SQL
Select FIELD1
from table ;