Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Remove the last row / Max Row

I have a table of file names and I want to load all files except last file (max number). I will use "for loop" to load files. How can I remove last row from the table

FileName

1

2

3

4

I want

FileName

1

2

3

1 Solution

Accepted Solutions
Not applicable
Author

Hi

Please have a look this one.

Thanks

View solution in original post

3 Replies
Not applicable
Author

Hi

Please have a look this one.

Thanks

Not applicable
Author

Hi Naskar,

Can you please explain the procedure to achieve.

As I'm using personal edition.

Thanks in Advance.

Regards,

Pavan.

Not applicable
Author

Hi

Please try this script :

Loading data form Source :

Temp_Data:
LOAD FileName,
rowno() as Recno
FROM
Data2.xlsx
(
ooxml, embedded labels, table is Sheet1);
Find the last record form source:
LoadMax:
Load max(Recno) as Recno1 Resident Temp_Data;

Let vMaxNo=Peek('Recno1',0,'LoadMax');

Data:
NoConcatenate
LOAD
*
Resident Temp_Data where Recno<>$(vMaxNo);

Drop tables Temp_Data,LoadMax;

Thanks