Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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




Tags (2)
1 Solution

Accepted Solutions
mov
Esteemed Contributor III

Re: Load from sql server

Try to load it as text:

LOAD

text(CODE) as CODE,

TXT;

SQL SELECT

CODE,

TXT

FROM ...

2 Replies
mov
Esteemed Contributor III

Re: Load from sql server

Try to load it as text:

LOAD

text(CODE) as CODE,

TXT;

SQL SELECT

CODE,

TXT

FROM ...

Re: Load from sql server

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
Community Browser