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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

SQL Script - Number of Records, Load 1 - N1, N1-N2, N2-Last Record

Hi guys,

Please help, supposed I want to load all records from one table and i don't know how many records are present.

How can I do the scripting for the following:

1. Identify the number of records/rows in the table and use this value to select the records -

Supposed I have three millions rows, what I wanted to do is to divide the loading into six load as follows:

3M / 6 = 500,000

1st Load :   Select Records from 1 - 500,000

2nd Load :  Select Records from 500,001 - 1,000,000

.

.

6th Load : Select Records from 2,501,000 - TILL THE LAST RECORD

The script above will not be loaded one after the other, I will load this all at the same time.

Thanks. Marson

3 Replies
Sokkorn
Master
Master

Hi Marson,

To identify number of records/rows need to use RowNo() function.

Like this:

[tblName]:

LOAD

RowNo() AS [No],

F1,

F2,

.....

Hope this help.

Regards,

Sokkorn

Not applicable
Author

Will it automatically select the last record and get the rowno

OR go through all the records, get the rowno and store it in No Field?

Not applicable
Author

to get the total no of records u can use function noofRecords(Fieldname).

Thanks

Vivek