Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

dineshraj
Contributor

Loading Certain Number of rows

Hi Experts,

            I need to load certain number of loads with multiple files. I have attached a sample file.

6 Replies
MVP
MVP

Re: Loading Certain Number of rows

Prefix the LOAD with a 'First n' clause. For example, to get the first 100 rows:

     First 100 LOAD .... FROM ....

dineshraj
Contributor

Re: Loading Certain Number of rows

Hi Jonathan,

            I can't specify 100 because it changes file to file. For Eg In file one ID2 starts in the 6th row but in second file ID2 may starts from 1000.

Thanks & Regards,

Dineshraj

avkeep01
Valued Contributor

Re: Loading Certain Number of rows

Hi Dineshraj,

I created a little script which marks the first row with 1, if the column ID changes to ID2, this number is increaded with 1. So then you do a resident with a where clause: Check = 1

LOAD
ID,
IF(ROWNO()=1,1,IF(ID<>'ID2',PEEK('Check',-1),PEEK('Check',-1) + 1)) AS Check,
Amount
FROM
\\SSCDATA09.frd.shsdir.nl\LT_516745$\Downloads\Sample.xlsx
(
ooxml, embedded labels, table is Sheet1);


dineshraj
Contributor

Re: Loading Certain Number of rows

Hi Van Keep,

         It is not working for multiple sheets loading.

Thanks & Regards,

Dineshraj

MVP
MVP

Re: Loading Certain Number of rows

Your original question was answered above, but it seems like you need more than you asked.

If it is not a constant number of rows, then perhaps you should explain in more detail your requirements. That would spare you and everyone else from playing guessing games.

avkeep01
Valued Contributor

Re: Loading Certain Number of rows

Hi Dineshraj,

Then you could make a loop over the script I posted with the correct sheet names. Then store the data in een qvd and drop the table and then start the loop again untill you've got all the different sheets loaded.

Then you just load all .qvd's at once.