14 Replies Latest reply: Jun 3, 2015 12:19 PM by Shiva Reddy

# How to display top 2 salary in qlikview with expression?

HI,

I created straight table  in qlikview.I want to display top2 salary in qlikview with expression.pls tell me out how to display top2 salary in qlikview.

Thankyou,

Regards

• ###### Re: How to display top 2 salary in qlikview with expression?

Please post some sample data or QVW.

Also what have you tried with expressions so far may help.

• ###### Re: How to display top 2 salary in qlikview with expression?

this is my straight table I want to display top2 salary in this table with expression pls tell me out brain garside.

thankyou,

• ###### Re: How to display top 2 salary in qlikview with expression?

this expression show s  error sum(if(rank(sum(salary),2)=2)salary) pls solve this problem.

• ###### Re: How to display top 2 salary in qlikview with expression?

Did you try Dimension Limits tab? I think that's the easiest way to handle similar situations.

• ###### Re: How to display top 2 salary in qlikview with expression?

here are several expressions that would probably work

Customers Having Top 4 Values

• ###### Re: How to display top 2 salary in qlikview with expression?

expre-->sum(if(rank(sum(sales),2)=2)sales)

• ###### Re: How to display top 2 salary in qlikview with expression?

Thankyou pratap.

• ###### Re: How to display top 2 salary in qlikview with expression?

pratap it shows error =sum(if(rank(sum(salary),2)=2)salary)

• ###### Re: How to display top 2 salary in qlikview with expression?

Place a 2 in the Dimension limits for largest values in this example I have a variable in place of 2 so it can be whatever you wish it to be.

There is no need to create an expression if you using a Straight table.

However if you need it to go in a Text box then you will need one.

The expression you have should work if you go that route.

• ###### Re: How to display top 2 salary in qlikview with expression?

Dim-->id,name(If(aggr(Rank(Sum(sal))<=2,name),name)) by edit wth add cal dim

And

Expression--->  Sum(sal)

where as Bottom2 you can add sign

If(aggr(Rank(-Sum(sal))<=2,name),name)

Hope, below snap would be helpful.

• ###### Re: How to display top 2 salary in qlikview with expression?

Try Like this:

rank( sum( salary), 2 )

• ###### Re: How to display top 2 salary in qlikview with expression?

avinash I wrote that expression like this rank( sum( salary), 2 ) in expression tab. but it display  below.it didnot  show values.

• ###### Re: How to display top 2 salary in qlikview with expression?

try tis,

If(aggr(Rank(Sum(salary))<=2,salary),salary)

• ###### Re: How to display top 2 salary in qlikview with expression?

IT DISPLAY SECOND HIGHEST ID  BUT I WANT TO DISPLAY 2ND HIGHEST SALARY.PLS SOLVE THIS PROBLEM .HOW TO DISPLAY SECOND HIGHEST SALARY .

REGARDS