Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
Not applicable

Top and Rank

Hi

I have 2 questions.

Firs: Maybe do you know how through button I can  to select in filter (list) thise products ( top 4)

But I don't understand why I see 3 products, if my exspression - Product = {"=Rank(Sum(volumn))<=4"}

Мй.png

and

Second

How Qv selects which display in top product, if they are of equal value

v2.png !

Tags (2)
1 Solution

Accepted Solutions
MVP
MVP

Re: Top and Rank

Then this should do the trick:

2017-01-03 09_23_32-Edit Expression.png

8 Replies
stabben23
Honored Contributor

Re: Top and Rank

Hi,

if you add rank in Your straight table you see that you have 3 Product that is <=4.

rank.GIF

If they have the same value, qlikview wont know who to display, both will be visible.

pathiqvd
Contributor III

Re: Top and Rank

Hi,

       If you want to show top 3 products volumn. don't use rank function in expressions use in add calculated dim, try below this

Add calculated dim:- =if(aggr(rank(sum(volumn)),product)<=3,product)

exp:-   sum(volumn)

regards,

Not applicable

Re: Top and Rank

I want, if I click on the button  "Rank", in list i see product like to text object  ( first questions)

MVP
MVP

Re: Top and Rank

Rank() function can take two additional parameters: mode and fmt

The documentation explains the additional parameters and how they affect the ranking:

http://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/ChartFunctions/RankingFunctions/r...

In your textbox you will have to use this expression to get all four top ranking products:

=Concat(DISTINCT {<Product = {"=Rank(Sum(volumn),4)<=4"}>} Product, ' | ')

Notice the added second parameter to Rank in this expression. Mode=4 which means that every ranked product should get a unique ranking even if two or more products rank equally. With you Rank with no additonal parameters you will get a numeric ranking of 1 to 3 for each product and the rest of the products are ranked from 5 and upwards - it leaves a missing rank of 4 since two products are ranked as 1.

For your second question - you can by using the additional mode parameter to choose whether you will have the same ranking value for two or more products that have equal ranking or if they should have unique rankings even if they are equal. They will then be ranked according to sort order in your chart.

Notice also that Rank returns dual values - both a text and a number.

I have attached a modified QlikView app to illustrate a little bit:

2017-01-03 08_42_48-QlikView x64 - [C__Users_psd_Downloads_Rank and button.qvw_].png

MVP
MVP

Re: Top and Rank

I updated you sample application to work with a button too - see attached QVW...

pathiqvd
Contributor III

Re: Top and Rank

Hi,

    Try this in text object

create one variable like vBT after create button and write below condition in ext object

=if(vBT=0,concat(if(aggr(rank(sum(volumn)),product)<=3,product),'|'))

Regards,

Not applicable

Re: Top and Rank

thanks, but I want

button effect on the list

Clip2net_170103110252.png

MVP
MVP

Re: Top and Rank

Then this should do the trick:

2017-01-03 09_23_32-Edit Expression.png