Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

fisland92
New Contributor III

rank in text object

hi there,

ı want to display top 3 values in a text objext of a dimension.

how can ı do this?

Tags (2)
8 Replies
prma7799
Honored Contributor III

Re: rank in text object

Try this

aggr(if( rank(sum(Sale),4)<=3,State), State)

or

aggr(if( rank(sum(Sale))<=3,State), State)

aggr(if( rank((YourExpression))<=3,Dimension), Dimension)

sergio0592
Valued Contributor II

Re: rank in text object

Try with in text box :

='First :'&FirstSortedValue(Dimension, - Expression, 1) &Chr(10)&'Second:'&FirstSortedValue(Dimension, - Expression, 2) &Chr(10)&'Third:'&FirstSortedValue(Dimension, - Expression, 3)

antoniotiman
Honored Contributor III

Re: rank in text object

May be like this

=Concat({<Dimension={"=Rank(Sum(Value)) <= 3"}>} Money(Aggr(Sum(Value),Dimension)),Chr(10))

Re: rank in text object

When you need text object?

=Concat({<[Ticket ID]={"=Rank(Sum(Sales), 4) <= 3"}>}  Aggr(Sum(Sales),[Ticket ID]),Chr(10))

antoniotiman
Honored Contributor III

Re: rank in text object

=Concat({<Dimension={"=Rank(Sum(Value)) <= 3"}>} Distinct Dimension,Chr(10))

fisland92
New Contributor III

Re: rank in text object

thanks for reply,

I have "term" dimension, and I wrote it like that;

=aggr(if( rank ( (sum(sales)-above(sum(sales),-1))/above(sum(sales),-1)) = 1,term), term)

it displays result but the wrong result. does not give the right rank=1 term

when I use the same formula

rank ( (sum(sales)-above(sum(sales),-1))/above(sum(sales),-1)) = 1

in a table, it gives different result.

prma7799
Honored Contributor III

Re: rank in text object

Please share some sample file with expected output.

shraddha_g
Honored Contributor III

Re: rank in text object

concat({<term = {"=rank(sum(Sales)) <=3"}>} Distinct term, chr(10))