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

SQL load data - value changed by QlikView

When loading data from a databases, I have a table with my articles which each have a unique itemno, which is alfa-numerical (character).

In my database, I have an item with itemno "850" and one with itemno "00850".

When loading this into QlikView (qvd files), QlikView loads them both as "00850", and thereby eveyr report based on itemno is wrong.

When i adapt the SQL load statement to say "... where ITEMNO = '850', only 1 item is loaded and displayed as "850", when it says "... where ITEMNO = '00850' also only 1 item is loaded en now displayed as "00850" (correct)

How can I make QlikView load my items correctly, that is, without chaging the value of any field?

Thx,

Yves.

1 Solution

Accepted Solutions
Not applicable
Author

Hi

Try this one

Tab1:

Load FIRMANR, ARTNR, text(ARTNR) as ARTNR_t, GROEP1;

SQL SELECT FIRMANR, ARTNR, GROEP1 FROM PUB.ARTI;

Thanks

Saran.

View solution in original post

5 Replies
hector
Specialist
Specialist

Hi, have you tried the text() function?

Use

Load
*,
text(ITEMNO) as ITEMNO_T
;
SQL
Select from...;

This will keep the leading zeroes of the record.

Rgds

Not applicable
Author

Hi,

I tried now, but I get een error msg then.

This is the SQL statement:

Artikel:

SQL SELECT

FIRMANR,

ARTNR,

text(ARTNR) as ARTNR_t,

GROEP1

FROM PUB.ARTI;



The error is "syntax error in sql statement".

The field i'm having trouble with is "ARTNR"

Regards,

Yves.

Not applicable
Author

Hi

Try this one

Tab1:

Load FIRMANR, ARTNR, text(ARTNR) as ARTNR_t, GROEP1;

SQL SELECT FIRMANR, ARTNR, GROEP1 FROM PUB.ARTI;

Thanks

Saran.

hector
Specialist
Specialist

try this

Artikel:

Load
FIRMANR,
ARTNR,
text(ARTNR) as ARTNR_t,
GROEP1
;
SQL SELECT
FIRMANR,
ARTNR,
GROEP1
FROM PUB.ARTI;

Text() is a QV function, so it must be placed into a Load statement rgds

Not applicable
Author

Off course.

Thx a lot Saran and Héctor.

Regards,

Yves.