Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
maxgro
MVP
MVP

Load from sql server


I'm loading some data from a sql server database

CODE 001,         description (TXT) Acquisto su ....

CODE 01,           description (TXT) Vendita normale  

qv from sql server 1.jpg


Same data loaded with same query in qlikview (image below)

DLVREASON:

LOAD   *   ;

SQL

select CODE, TXT

from dlvreason where code < '20'

and dataareaid='els6' order by 1;


and I have the same 001 CODE with two different description

Code 001, description (TXT) Acquisto su ....

Code 001, description Vendita normale 


has anyone encountered the same problem? solution?


qv from sql server 2.jpg




1 Solution

Accepted Solutions
Anonymous
Not applicable

Try to load it as text:

LOAD

text(CODE) as CODE,

TXT;

SQL SELECT

CODE,

TXT

FROM ...

View solution in original post

2 Replies
Anonymous
Not applicable

Try to load it as text:

LOAD

text(CODE) as CODE,

TXT;

SQL SELECT

CODE,

TXT

FROM ...

Gysbert_Wassenaar

Qlikview interprets your codes as numbers with a display format. The first 001 is interpreted as 1 with display format 001. The next value 01 is also interpreted as 1 and gets the same display format as the first 1 because a number can have only one display format. And so on for 002-02, 003-03 etc. The solution is to use the text() function:

DLVREASON:

LOAD  text(CODE),TXT   ;

SQL

select CODE, TXT

from dlvreason where code < '20'

and dataareaid='els6' order by 1;


talk is cheap, supply exceeds demand