Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Aggregate calculation

Hi,

I am trying to build a report with Manufacturer, Quantity Sold:  Today, Week, Month and Best Week. I can easily make the report for Today, Week, Month, but I don't have any clue how to find the best weekly sales in this month?

Eg:

ManufacturerToday QtyWeek QtyMonth QtyBest Week Qty in this month
HP52010028
Canon83017047

Can anyone please suggest a solution for this?

Thanks,

Dony

6 Replies
avinashelite

Hi Dony,

Can you please provide the sample data.

maleksafa
Specialist
Specialist

you should use the rank function, and aggregate the sum(Week Qty) by Month.

Can you upload a small document, to check the dimensions properly?

Not applicable
Author

Hi Malek Safa,

Thanks for you reply.

I can make a report like this from your suggestion

WeekQuantityRank


355041
363632
333003
322804
302705
312606
292557
282408
342389
2723510

Week: Dimension

Quantity: Sum({<Date={'>$(=QuarterStart(today())) <$(vTodayThisYear)'}>}[Invoiced Quantity])

Rank: RANK(Sum({<Date={'>$(=QuarterStart(today())) <$(vTodayThisYear)'}>}[Invoiced Quantity]))

From This I need to find only quantity 504( ie, Rank=1).

Can you please help me to do this by using aggr and Rank function as you have suggested?

Thanks,

Dony

maleksafa
Specialist
Specialist

Hi,

i have uploaded a document showing how does the rank and aggr work together, very similar to the one that you want, you only have to replace the fields.

please tell me if this is what you need.

Not applicable
Author

Hi Malek,

Thanks for your help. I fixed the issues now.

Thanks,

Dony

maleksafa
Specialist
Specialist

Great, then please close this topic to answered and by marking answers as helpful or correct answer.