Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
dineshraj
Partner - Creator
Partner - Creator

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
jonathandienst
Partner - Champion III
Partner - Champion III

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

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

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
dineshraj
Partner - Creator
Partner - Creator
Author

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
Partner - Specialist
Partner - Specialist

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
Partner - Creator
Partner - Creator
Author

Hi Van Keep,

         It is not working for multiple sheets loading.

Thanks & Regards,

Dineshraj

jonathandienst
Partner - Champion III
Partner - Champion III

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.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
avkeep01
Partner - Specialist
Partner - Specialist

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.