Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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
Valued Contributor

Re: Selecting only a few rows.

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

Limited Load.JPG

5 Replies
Not applicable

Re: Selecting only a few rows.

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
Valued Contributor

Re: Selecting only a few rows.

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

Limited Load.JPG

Not applicable

Re: Selecting only a few rows.

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

Re: Selecting only a few rows.

Thanks! That's what i was looking for.

Not applicable

Re: Selecting only a few rows.

Also one possible way is to use

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

Community Browser