Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Limiting data in a LOAD-statement

Hello!

When I select data from an ODBC-source, I can limit the selected data with the WHERE-clause.

I.e.:

SELECT *

from BI.example

where DATE > '01.01.2006';

I'd like to know the equivalent, if I LOAD data from a .qvd-file and only want to load data which match the given criteria, i.e. only one specific customer-ID. The WHERE-clause doesn't work in combination with LOAD, afaik.

I bet this is a simple thing but I didn't figure it out yet.

1 Solution

Accepted Solutions
dmohanty
Partner - Specialist
Partner - Specialist

Don't forget to add (qvd) after .qvd...Ex: FROM Struktur\ARTIKEL.qvd(qvd)

Or else instead of writing the script, load it from Table Files.

View solution in original post

12 Replies
Not applicable
Author

This is what I do:

SHE:

LOAD    ARTIKELNR,

             LABELNR

FROM        Struktur\ARTIKEL.qvd

where         LABELNR = 33271;

The from-clause alone works this way.

Not applicable
Author

I forgot to mention the error message. QV recognizes the where-statement as part of the filename and -path.

QV Server - 172.16.1.png

Not applicable
Author

use:

LOAD    ARTIKELNR,
             LABELNR

FROM        Struktur\ARTIKEL.qvd(qvd) 
where         LABELNR = 33271;

make sure the field LABRLNR is number.

if it is string u need to use LABELNR='33271'

Not applicable
Author

I tried both before. As I said: problem seems to be that QV does interpret the where-statement as part of the filepath (see the error message screenshot).

I do not use a directory-statement to ensure that QV uses relative paths instead of absolutes. This works everywhere in the script but it seems as if it does not in this special case.

Not applicable
Author

i understand English only.....so cant understand ur error mseg....

may be u can translate

Not applicable
Author

Error opening file 'D:\Workarea\QVDs\Struktur\ARTIKEL.qvd where LABELNR = 33273' etc.

You can see at the quote signs that QV thinks of the whole expression as filename...

Not applicable
Author

have you tried (qvd) after .qvd ?

Not applicable
Author

have u used : FROM Struktur\ARTIKEL.qvd(qvd)

if yes......and it didn't work.....just delete ur script and use the 'Table files' button to select from ur qvd after checking the box 'Relative paths' and just remove the semi colon after the statememt generated and put the where clause.

dmohanty
Partner - Specialist
Partner - Specialist

Don't forget to add (qvd) after .qvd...Ex: FROM Struktur\ARTIKEL.qvd(qvd)

Or else instead of writing the script, load it from Table Files.