Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
amit_shetty78
Creator II
Creator II

Split data in load on number of rows

Hi all,

I would like to split the data from source into multiple tables in Qlikview by the number of rows, say max 100 in each table. Say I have 350 rows in source. When I load into QV I want it to be loaded into 4 tables: 1st with 100 rows, 2nd with 100 rows, 3rd with 100 rows and 4th with 50 rows?

Is this possible?

Thanks in advance,

Amit.

1 Reply
prieper
Master II
Master II

Surely you may do so, but for which purpose?

Script may look like:

SourceData:

    LOAD

        CEIL(RAND() * 10)        AS Val,

        RECNO()                    AS Rec

    AUTOGENERATE

        1000;

       

LET iLoop = 1;

FOR i = 1 TO NOOFROWS('SourceData') STEP 100

LET sTable = 'PartialData' & iLoop;

$(sTable): LOAD Val AS Val$(iLoop) RESIDENT SourceData WHERE Rec >= $(i) AND Rec < $(i) +100;

LET iLoop = iLoop + 1;

NEXT i;

DROP TABLE SourceData;

HTH
Peter