Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I am loading data from excel sheet and this excel get updated in every 5 minute. Data is look like as below:
Date | Value1 | Value2 |
---|---|---|
5/9/2016 3:15:47 AM | 25 | 30 |
5/9/2016 3:20:47 AM | 27 | 23 |
Now I want to load last 5 records. I know about first 5 but there is no Last 5.
Can anyone help me.
Thanks.
Hi Soha,
You can use the logic of incremental load with update.
Incremental Load in Qlikview - Sources
Hope it helps you better.
Regards,
Mahamed
Data:
LOAD Date,
Value1,
Value2
FROM Table:
New:
noconcatenate
First 5 LOAD *
resident Data
order by Date desc;
drop table Data;
Hi,
Logic can be Load table with descending order and load first 5
Kind Regards
Is there any way where we will load only last 5 records from excel. This solution is correct but here first we need to load all the records, assume later stage when lacs of record is there then it will take time load.
Yeah but you cannot load the last five data directly without loading them all and perform sorting . You can directly load 5 records but it will pick random 5 records which will not be the correct solution.
or you can perform the descending sorting on Date in excel itself and then directly load first five records like below
Data:
First 5 LOAD *
FROM Excel
May be like this..
Temp:
Load
Count(Distinct RecNo()) as Total
FROM
Test.xlsx
(ooxml, embedded labels, table is Sheet1);
Let vTotalRows = (Num(Peek('Total', 0, 'Temp'))-2);
Drop Table Temp;
Final:
LOAD * FROM
Test.xlsx
(ooxml, embedded labels, table is Sheet1)
Where RecNo() >= $(vTotalRows);
Let vTotalRows = Null();
Hi Soha,
It is possible, If you have any last updated date column into your excel file then you can filter your first data using this date field so that the required data only will get loaded.
Regards,
Mahamed