Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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.
Not applicable

Top n data

1st table    

AirportRevenue in US$Flights 
Grand Total57,732,036,7571,068,164
Maya-Maya Airport
24,082,856,986467,982
Asmara International Airport
16,156,464,665280,323
Cairo International Airport
10,150,200,885188,215
Tripoli International Airport
3,460,486,57248,468
Cape Town International Airport
2,335,975,37144,474
Calgary International Airport
772,424,866  14,234
Vancouver International Airport
505,395,81211,452
Ontario International Airport
268,231,60113,016

2nd table extracted from 1st table(Top 3 Airports)    

AirportRevenue in US$Flights 
Grand Total50,389,522,535936,520
Maya-Maya Airport
24,082,856,986467,982
Asmara International Airport
16,156,464,665280,323
Cairo International Airport
10,150,200,885188,215

I am having problem in acquiring the result of 2nd table. Can anyone help me? I want to see any top n airports with revenue & flight detail as mentioned in the 2nd table.

Tags (1)
8 Replies
pradosh_thakur
Honored Contributor II

Re: Top n data

hi

try this

dimesnison limits-> largest 3 value and dont show  others

will this work for you ?

regards

Pradosh

Learning never stops.
Not applicable

Re: Top n data

I do not want to use dim limits as I have already used variable vCounter which varies from 0 to 8 where 0 means all airports & remaining numbers for top n. I actually need to know the exact expression to be used for both revenue & flights in case of all or top n.

pradosh_thakur
Honored Contributor II

Re: Top n data

You can use the variable in place of that number something like =$( vCounter) iin the expression. It will be the simplest solution for you.

Learning never stops.
Not applicable

Re: Top n data

I need to know the exact expression to be used for the issue.

pradosh_thakur
Honored Contributor II

Re: Top n data

can you share your sample app? Please try using =$(variablename ) in the dimensionlimit tab to show the top n value.

Learning never stops.
effinty2112
Honored Contributor

Re: Top n data

Hi Arshad,

Try this as your dimension:

Aggr(if(Rank(Sum(Revenue),1,1) <=3,Airport),Airport)

In a straight table check the Suppress When Value Is Null checkbox.

Regards

Andrew

Not applicable

Re: Top n data

The problem exists in expression tab not in dimension. I need to know exact expression to be used for top n.

effinty2112
Honored Contributor

Re: Top n data

Hi Arshad,

Have you tried the calculated dimension? It will give you the top 3 in a straight table.

Regards

Andrew

Community Browser