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

Selecting only a few rows.

Hello,

I just started working with Qlikview for my company, and i'm extracting some data from the database to see which fields i actually need. is it possible to select only, let's say, 40 rows from a table? This is my code. I want to put it in a QVD file to do some tests. but I dont want to put all the data in there cause there's alot of data in our database and it will take a long time.

[Stock]:

LOAD

    PART1_PART               as [KeyPart], //Primary Key

    PARTSTD_SOURCE     as [Source],

    PARTQTY_STOCK        as [InStock],

    PARTMRP_STOCK       as [SubStock],

    PARTQTY_TRANS        as [InTransit],

    PARTQTY_QUAR         as [PartStockQuaraine],

    PARTQTY_1                 as [PartStockRemoteStores],

    date(today())                 as [Date]

;

SQL SELECT 

    PART1_CO_SITE,

    PART1_REC_TYPE,

    PART1_PART,

    PARTSTD_SOURCE,

    PARTQTY_STOCK,

    PARTMRP_STOCK,

    PARTQTY_TRANS,

    PARTQTY_QUAR,

    PARTQTY_1

FROM PART_DATA

WHERE PART1_CO_SITE ='$(Company)'

AND PART1_REC_TYPE=1;

STORE [Stock] INTO "DATA_NEW/Stock.QVD";

1 Solution

Accepted Solutions
amars
Specialist
Specialist

Go to Edit Script -> Debug -> use limited Load with 40

Limited Load.JPG

View solution in original post

5 Replies
Not applicable
Author

try in this format.

Load *

where  MASTER_ID = 0;

SQL

SELECT *

FROM  Persons;

*****************************************

Now in your script

$(Company) indicates the variable, so it must be define.


[Stock]:
LOAD
    PART1_PART               as [KeyPart], //Primary Key
    PARTSTD_SOURCE     as [Source],
    PARTQTY_STOCK        as [InStock],
    PARTMRP_STOCK       as [SubStock],
    PARTQTY_TRANS        as [InTransit],
    PARTQTY_QUAR         as [PartStockQuaraine],
    PARTQTY_1                 as [PartStockRemoteStores],
    date(today())                 as [Date]
;

SQL SELECT 
    PART1_CO_SITE,
    PART1_REC_TYPE,
    PART1_PART,
    PARTSTD_SOURCE,
    PARTQTY_STOCK,
    PARTMRP_STOCK,
    PARTQTY_TRANS,
    PARTQTY_QUAR,
    PARTQTY_1
FROM PART_DATA
WHERE PART1_CO_SITE ='$(Company)'
AND PART1_REC_TYPE=1;


STORE [Stock] INTO "DATA_NEW/Stock.QVD";


amars
Specialist
Specialist

Go to Edit Script -> Debug -> use limited Load with 40

Limited Load.JPG

Not applicable
Author

I don't follow you, i'm sorry. I defined the variable.

I was searching, and in this possible?

SQL

First(40) SELECT 

          PART1_CO_SITE,

    PART1_REC_TYPE,

    PART1_PART,

    PARTSTD_SOURCE,

    PARTQTY_STOCK,

    PARTMRP_STOCK,

    PARTQTY_TRANS,

    PARTQTY_QUAR,

    PARTQTY_1

FROM PART_DATA

WHERE PART1_CO_SITE ='$(Company)'

AND PART1_REC_TYPE=1;

Not applicable
Author

Thanks! That's what i was looking for.

Not applicable
Author

Also one possible way is to use

Where ROWNUM < 40 //works at least in PL SQL