Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
In my table i have 100 records. i want show first 5 record, and last five records. what can i do for that?
Please check below link it will help you to achieve your requirement
How to find top 5 and bottom 5 records in chart | Qlik Community
We can call it as
First 10
Load * from Table;
I am not sure whether there is any direct way to fetch last 10 Records
This way:
Create one column in script let's called it Row
RowNo() as Row
Now you have one column which have row number for each line, Load first 5 item and Concatenate the Table with Bottom 5 items
********************Logic**************
Table:
First 5
Load *
From Table
Order By Row Asc;
Concatenate
First 5
Load *
From Table
Order By Row Asc Desc;
*************************Sample Script***************************
Data:
LOAD *,
RowNo() as Row;
Load *
Inline
[
Code11, Val11
1, 100
2, 200
3, 250
4, 150
5, 120
6, 100
7, 200
8, 180
9, 110
10, 80
11, 250
12, 220
13, 190
14, 140
15, 120
16, 130
17, 110
18, 220
19, 210
20, 190
];
NoConcatenate
NewData:
First 5
LOAD *
Resident Data
Order By Row Asc;
Concatenate
First 5
LOAD *
Resident Data
Order By Row Desc;
DROP Table Data;