Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

jacobesalas
New Contributor III

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?

Tags (2)
1 Solution

Accepted Solutions

Re: Load x amount of rows

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 ;

7 Replies

Re: Load x amount of rows

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 ;

MVP & Luminary
MVP & Luminary

Re: Load x amount of rows

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

MVP & Luminary
MVP & Luminary

Re: Load x amount of rows

Jinx!

jacobesalas
New Contributor III

Re: Load x amount of rows

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

jacobesalas
New Contributor III

Re: Load x amount of rows

I did order by -ROWID

that gave me the right answer.

MVP & Luminary
MVP & Luminary

Re: Load x amount of rows

Have you tried ordering in descending order?

ORDER BY ROWID DESC

jacobesalas
New Contributor III

Re: Load x amount of rows

Just did.  This also works.  Thank you!