Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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

Re: Aggregate calculation

Hi Dony,

Can you please provide the sample data.

maleksafa
Valued Contributor

Re: Aggregate calculation

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

Re: Aggregate calculation

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
Valued Contributor

Re: Re: Aggregate calculation

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

Re: Re: Aggregate calculation

Hi Malek,

Thanks for your help. I fixed the issues now.

Thanks,

Dony

maleksafa
Valued Contributor

Re: Re: Aggregate calculation

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

Community Browser