Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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
Not applicable

Re: Limiting data in a LOAD-statement

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.

12 Replies
Not applicable

Re: Limiting data in a LOAD-statement

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

Re: Limiting data in a LOAD-statement

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

Re: Limiting data in a LOAD-statement

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

Re: Limiting data in a LOAD-statement

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

Re: Limiting data in a LOAD-statement

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

may be u can translate

Not applicable

Re: Limiting data in a LOAD-statement

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

Re: Limiting data in a LOAD-statement

have you tried (qvd) after .qvd ?

Not applicable

Re: Limiting data in a LOAD-statement

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
Not applicable

Re: Limiting data in a LOAD-statement

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.