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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to fetch Last row w/o fetching Entire Data from excel

Hi Friends,

I had a requirement to fetch last Row alone from the excel. The problem here is, it takes long time to fetch entire data, so instead i need only Last Row to use it in QV Reporting, Plz help me..

11 Replies
its_anandrjs
Champion III
Champion III

Hi,

If you know the last record no so put code some thing like suppose there is 10 records and you want to laod 10 records as you ask

Example:--

Load

Fields,

......

......

From

where RecNo() = 10 ;

Rgds

Anand

Not applicable
Author

It's not constant .The row count will defer every time

its_anandrjs
Champion III
Champion III

Hi,

Use

LET a = NoOfRows('tab1');

and then load statement

Load

Fields,

......

......

From

where RecNo() = 10 ;

Rgds

Anand

its_anandrjs
Champion III
Champion III

Hi,

Once load your table with load and this LET a = NoOfRows('Data'); line and after that put

Where RecNo() = $(a); this condition to your load statement

Data:

Load

Fields

........

From

Data

Where RecNo() = $(a);

LET a = NoOfRows('Data');

Rgds

Anand

Not applicable
Author

Loading entire data takes me 10mins of time. I need the report to be loaded in 1min.
That is the problem, Last row does not contain maximum value in it, so i can order by also.

Thanks alot for your replies.

its_anandrjs
Champion III
Champion III

Hi,

Ok see the attached sample file if you does not want to keep Data table so delete it otherwise you keep that by this you load last row A10 value in single load

Data:

LOAD * Inline

[

Info

A1

A2

A3

A4

A5

A6

A7

A8

A9

A10

];

LET a = NoOfRows('Data');

Newdata:

load

Info as NewInfo

Resident Data

Where RecNo() = $(a);

//DROP Table Data;

HTH

Let me know about this

Rgds

Anand

SunilChauhan
Champion II
Champion II

see the attached qvw

and excel

hope this helps you

Sunil Chauhan
Not applicable
Author

Here u r calculating last row of it after loading entire Data from excel. I don't want to load the entire file because it's time consuming...
For fetching the first record in the excel, i m having 'First' keyword, but for Last?

its_anandrjs
Champion III
Champion III

Hi,

Ok understood if you use header option in the load then you are able to load last row.

Ex:-

Data:

LOAD *

FROM

Data.xlsx

(ooxml, embedded labels, header is $(a) lines, table is Sheet1);

 

LET a = NoOfRows('Data');

Rgds

Anand