Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
HermGerm
Contributor II
Contributor II

SQL Select, keeping leading zero

Im selecting a Table which contains values like this:

SQL-TABLE:

KEYFIELD   VALUEFIELD

070               TEXT1

70                  TEXT2

010               TEXT3

020               TEXT4

030              TEXT5

After Loading the Table inside Qlik is looking like this

QLIK-TABLE:

KEYFIELD   VALUEFIELD

70               TEXT1

70                  TEXT2

010               TEXT3

020               TEXT4

030              TEXT5

 

Problem is now, that Qlik is treating 070 the same as 70 and converts the 070 also to 70. How can i prevent qlik from doing this? It should extract the data exact like it is in the SQL.

Labels (1)
1 Solution

Accepted Solutions
tresesco
MVP
MVP

That way, you probably would not find that table loaded. Try instead using preceding load like:

MyTable:
LOAD
Text(KEYFIELD) as 'KEYFIELD',
VALUEFIELD 
;
SQL SELECT
ABTNR as 'KEYFIELD',
VALUEFIELD
FROM SQLTABLE;

 

View solution in original post

3 Replies
tresesco
MVP
MVP

Try loading the field as text like:
Load
     Text(KEYFIELD) as KEYFIELD

HermGerm
Contributor II
Contributor II
Author

Thank you, but this is not working or Im doing it wrong:

 

SQLTable:
SQL SELECT
ABTNR as 'KEYFIELD',
VALUEFIELD
FROM SQLTABLE;

MyTable:
LOAD
Text(KEYFIELD) as 'KEYFIELD',
VALUEFIELD
Resident SQLTable;

Drop Table SQLTable;

tresesco
MVP
MVP

That way, you probably would not find that table loaded. Try instead using preceding load like:

MyTable:
LOAD
Text(KEYFIELD) as 'KEYFIELD',
VALUEFIELD 
;
SQL SELECT
ABTNR as 'KEYFIELD',
VALUEFIELD
FROM SQLTABLE;