# QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
New Contributor

## Rank Aggr issue (Top impact)

Hi,

I'm in need of some help. I have a Straight table that shows Gross Margin impact this year compared to last in percent by product area. The Expression is a sum aggr on one dimension. My problem is that I want to show the top 3 Impact based on if the negative Impact is the biggest then I want the top 3 negative Impact to be shown and if the positive is the biggest I want the 3 top positive to show. Needs to be dynamical, the result can be different on different weeks. I tried the Rank function but haven’t got it to work. I past some example, How the table could look and what I want it to show.

Regards,

Ellinor

Tags (4)
3 Replies
Highlighted

## Re: Rank Aggr issue (Top impact)

Perhaps this?

Sum({<[Product Area] = {"=Rank(Sum(Impact)) <= 3)"}, Week = {'\$(=Max(Week))'}>} Impact)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
MVP

## Re: Rank Aggr issue (Top impact)

 My problem is that I want to show the top 3 Impact based on if the negative Impact is the biggest then I want the top 3 negative Impact to be shown and if the positive is the biggest I want the 3 top positive to show.

Based on the data you have provided, can you explain what do you mean by biggest negative and biggest positive impact here?

Highlighted
MVP

## Re: Rank Aggr issue (Top impact)

Here are two expressions based on my understanding of your requirement.... These will work when a week is selected

1) =If(Rank(Only(TOTAL Aggr(If(Rank(fabs(Impact)) = 1, Sign(Impact)), ProductArea))*Impact) < 4, Impact)

2) Only({<ProductArea = {"=Rank(Only(TOTAL Aggr(If(Rank(fabs(Impact)) = 1, Sign(Impact)), ProductArea))*Impact) < 4"}>}Impact)