Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

showing first 5 countries in list box

Hi

i want to know to display first 5 countries data in list box with out using normal if (match()).

is there any alternate

1 Solution

Accepted Solutions
its_anandrjs

You can try this in the load script

Ex:-

T1:

LOAD * Inline

[ Country

A

B

D

E

F

G

H ];

First5:

First 5

LOAD

Country,

Country as First5Country

Resident T1;

Note:- And then plot the First5Country field for the 5 country

View solution in original post

4 Replies
tresesco
MVP
MVP

Try like:

=If(Aggr(Rank(Country),Country)<6,Country)

Here, the ranking would be based on string sorting(alphabetical)

its_anandrjs

You can try this in the load script

Ex:-

T1:

LOAD * Inline

[ Country

A

B

D

E

F

G

H ];

First5:

First 5

LOAD

Country,

Country as First5Country

Resident T1;

Note:- And then plot the First5Country field for the 5 country

MK_QSL
MVP
MVP

Considering you have country and sales data... you can achieve that by using below expression in list box

=IF(Aggr(Rank(SUM(Sales),4),Customer)<=5,Customer)

maxgro
MVP
MVP

another one could be (but it depends on what's the meaning of first)

add an id in the load

load

....

autonumber(Country, 'Country') as idCountry

.....

and in the listbox use an expression

=if(idCountry<=5,Country,'Other')