Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
vishalmanu
New Contributor III

Top 3 countries and their sales in Text boxes

HI,

I have a table with countries and sales. No i have to display the top 3 countries in three different text boxes and their sales in the another three text boxes respectively.

Please suggest.

Thanks

5 Replies
pathiqvd
Contributor III

Re: Top 3 countries and their sales in Text boxes

Hi Vishnu,

Try like this,

For 1 st Rank in 1st text object:-

=Only(if(aggr(rank(sum(Sales)),Country)=1,Country))&'--'&sum({<Country={"=rank(Sum(Sales))=1"}>}Sales)

For 2 st Rank in 2st text object:-

=Only(if(aggr(rank(sum(Sales)),Country)=2,Country))&'--'&sum({<Country={"=rank(Sum(Sales))=2"}>}Sales)

.....Etc, Like rtry

Regards,

Re: Top 3 countries and their sales in Text boxes

May be this

=FirstSortedValue(DISTINCT Country, -Aggr(Sum(Sales), Country), 1) & Chr(10) &

Max(Aggr(Sum(Sales), Country), 1)

=FirstSortedValue(DISTINCT Country, -Aggr(Sum(Sales), Country), 2) & Chr(10) &

Max(Aggr(Sum(Sales), Country), 2)

=FirstSortedValue(DISTINCT Country, -Aggr(Sum(Sales), Country), 3) & Chr(10) &

Max(Aggr(Sum(Sales), Country), 3)

sergio0592
Valued Contributor II

Re: Top 3 countries and their sales in Text boxes

Hi, see the attached .qvw file. Hope it helps you.

pathiqvd
Contributor III

Re: Top 3 countries and their sales in Text boxes

Hi sunny stalwar1 ,


       I have one doubt suppose this situation how we can solve?

rank isuu.JPG

Regards,

Re: Top 3 countries and their sales in Text boxes

I guess it depends on what the output needs to look like? Would it be A & C or A or C as the top 1?

Community Browser