Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Support Case Portal has moved to Qlik Community! Read the FAQs to start exploring Support resources.
cancel
Showing results for 
Search instead for 
Did you mean: 
ellinorwihlborg
Contributor
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

3 Replies
Anil_Babu_Samineni

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)
sunny_talwar

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?

sunny_talwar

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)