Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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";
Go to Edit Script -> Debug -> use limited Load with 40
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";
Go to Edit Script -> Debug -> use limited Load with 40
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;
Thanks! That's what i was looking for.
Also one possible way is to use
Where ROWNUM < 40 //works at least in PL SQL