Skip to main content
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Dense Rank in QlikView

Hi All,

How to implement oracle data base dense_rank function in qlikview chart.



Appreciate your help on this!!!



3 Replies
Partner - Specialist
Partner - Specialist

Try this Num(Rank(Sum(Salary), 1))

Instead of 1 you can use differnet options

Mode 0 (default) Rows 2 and 3 share ranking but are clearly on the lower half of the total ranking. Their number representation is therefore rounded downwards to 2. Rows 4 and 5 share ranking too, but fall just above the middle of the ranking table. Therefore they get a number representation of the average of the first and the last rank in the column ((1+8)/2=4.5). This mode is especially useful when you want to use Visual Cues to mark the data ranking highest and lowest within a group.

Mode 1 In both cases the lower ranking figure within the group is used, i.e. 2 for rows 2 and 3, 4 for rows 4 and 5.

Mode 2 In both cases the average of the low and high ranking within the group is used, i.e. 2.5 ((2+3)/2) for rows 2 and 3, 4.5 ((4+5)/2) for rows 4 and 5.

Mode 3 In both cases the higher ranking figure within the group is used, i.e. 3 for rows 2 and 3, 5 for rows 4 and 5.

Mode 4 Each row is assigned its own distinct numeric value. The order within groups sharing a ranking is determined by the sort order of the chart's dimensions.

Hope this helps

Master III
Master III

Dimension: Employee

Expression: If(RowNo() = 1,1,If(Sum(Salary) = Above(Sum(Salary)),Above(Column(1)),Above(Column(1))+1))

Not applicable


Hi Shekar,

I tried this using "above" function.

1. Expression based on which I want Rank :

CL=      sum({<ST_Year={'2016'}>}EXTRA_FUEL)*2.2

2. Rank : just applied rank on above expression. I want rank 1 if sum is less, so applied negative sign also.

Rank=    rank(-sum({<ST_Year={'2016'}>}EXTRA_FUEL)*2.2)

3. Rank ‘-’  is to check whether that rank containing ‘-’ or not

if(index(rank(-sum({<ST_Year={'2016'}>}EXTRA_FUEL)*2.2) ,'-',1)>0 ,1,0)

4. Above ‘-’ is to check previous row rank containing ‘-’ or not

if( index(above(Column(2)),'-',1)>0,1,0)

5. In Rank & above ‘-’  , combining expression 3 & 4.

if(index(rank(-sum({<ST_Year={'2016'}>}EXTRA_FUEL)*2.2) ,'-',1)>0 ,1,0)=1 and
if( index(above(Column(2)),'-',1)>0,1,0)=1,

6. First Row: to check whether this row is First or not


7. Updated Rank : combining expressions in 5 & 6

if(above(Column(2))>=0,0,1)=1 ,
if(if(index(rank(-sum({<ST_Year={'2016'}>}EXTRA_FUEL)*2.2) ,'-',1)>0 ,1,0)=1,1,rank(-sum({<ST_Year={'2016'}>}EXTRA_FUEL)*2.2)),
if((if(if(index(rank(-sum({<ST_Year={'2016'}>}EXTRA_FUEL)*2.2) ,'-',1)>0 ,1,0)=1 and if( index(above(Column(2)),'-',1)>0,1,0)=1,1,0))=1,above(column(7)),above(column(7))+1)