Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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
Not applicable

Re: Lost leading zeroes from a text field

Hi Thierry,

This should work in that case.

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