Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
swati_rastogi27
Creator
Creator

Aggregations on the fly

Hi Experts,

How can we do on-the-fly aggregations using AGGR? 

I have a sample data set which has Product wise Sales and Revenue data starting Jan-2020 for 3 regions -> North America , Europe and Asia. I have these use cases to solve for : 

1. List the Top3 Products in terms of Sales YTD aggregated along with Aggregated Revenue for the same products-> This is solved ; Used below expression :

=if(aggr(Rank(sum(SALES)),PRODUCT_ID)<=3,sum(SALES))

2. A table which shows Sum of Sales for Top 3 Products YTD per Region and Revenue from the same products. Used this expression : 

sum( {<PRODUCT_ID = {"=Rank(sum(SALES),REGION) <=3"}>} SALES)

Problem is , it splits the Total Sales obtained in point 1 across the 3 Regions .

I want absolute number per region.

3. A table which shows Sum of Sales for Top 3 Products per month and Revenue from the same products for that month

Facing the same problem as above

I have attached the QlikView file along with the Data that i'm using.

Would appreciate your help.

Labels (1)
  • aggr

10 Replies
swati_rastogi27
Creator
Creator
Author

Awesome ! that solved it. 

Thanks so much