Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Load top n records


Hi

How do i load only top 5 records in qlikvew?

1 Solution

Accepted Solutions
vivek_niti
Partner
Partner

Hi,

Use the keyword FIRST before LOAD.

tab1:

FIRST 5 LOAD *

FROM ...........

View solution in original post

6 Replies
MK_QSL
MVP
MVP

Test:

Load Customer, Sales From TableName;

Left Join

Load Customer, SUM(Sales) as TotalSales Resident Test Group By Customer;

Noconcatenate

Final:
Load Customer, TotalSales Resident Test Where RowNo() <=5 Order By TotalSales Desc;

Drop Table Test;

vivek_niti
Partner
Partner

Hi,

Use the keyword FIRST before LOAD.

tab1:

FIRST 5 LOAD *

FROM ...........

View solution in original post

rajeshvaswani77
Specialist III
Specialist III

Hi Asma,

Use

table1:

FIRST 5 LOAD *

FROM ...........Tablename order by fieldname

Thanks,

Rajesh Vaswani

Not applicable
Author

JUST ADD

First N to a LOAD or SELECT statement , where N is the first number of records you want to load .

alkesh_sharma
Creator III
Creator III

Try this:

ON the script editor, select Debug -> limit load -> 5 -> start

its_anandrjs

Hi,

For finding Top 5 in the front end try this

Assume this example

Source:
LOAD * Inline [
Centers,Sales
A,98521
B,65823
C,32581
D,1587
E,12635
F,8426
G,12563
H,2569
I,78451
J,25638
K,45821
L,15896
M,1263
N,25874
O,7845
P,12589
]
;

Dim:-  =if( Aggr(Rank(Sum(Sales)) <= 5,Centers),Centers)
Expre:- Sum(Sales)

Or In script you can

Source:
LOAD * Inline [
Centers,Sales
A,98521
B,65823
C,32581
D,1587
E,12635
F,8426
G,12563
H,2569
I,78451
J,25638
K,45821
L,15896
M,1263
N,25874
O,7845
P,12589
]
;
Left Join
Load Centers, SUM(Sales) as Total Resident Test Group By Centers;
Noconcatenate
First 5
Final:
Load Centers, Total Resident Source
Order By TotalSales desc;
Drop Table Source; 

Regards,

Anand