Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Load x amount of rows

I want to only load the last 10,000 rows in my data set, where Status='R'.  Is there a simple way to do this?

1 Solution

Accepted Solutions
Colin-Albert

Is there a date field to identify the most recent records?

If there is you could use something like

FIRST 10000

LOAD

   ... ;

SQL select

   ...

From ....

Where Status = 'R'

Order by  your_date_field desc ;

View solution in original post

7 Replies
Colin-Albert

Is there a date field to identify the most recent records?

If there is you could use something like

FIRST 10000

LOAD

   ... ;

SQL select

   ...

From ....

Where Status = 'R'

Order by  your_date_field desc ;

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

You can load the FIRST x number of rows :

FIRST 10000

LOAD ...

So, if you sorted your data in a descending order (based on a date/time, or an ID) then you could limit your load to the last x number of rows.

cheers,

Oleg Troyansky

QlikView Your Business: An expert guide to Business Discovery with QlikView and Qlik Sense

Anonymous
Not applicable
Author

This works perfect.  but the Load is loading the first 10,000 with and with out the 'Order by' statement.

I am Ordering by ROWID.  in this case i get row 1-10000

Anonymous
Not applicable
Author

I did order by -ROWID

that gave me the right answer.

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Have you tried ordering in descending order?

ORDER BY ROWID DESC

Anonymous
Not applicable
Author

Just did.  This also works.  Thank you!