Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Calculation average

Hello,

I want to calculate the average of each product taking an account the number of periods that differs from a product to another.Capture.PNG

you can notice in the attachment that for the product "ADVANCE" there is only five periods available so the average will be the sum of Actual Sales divided by 5 and for the product ANATEO i have to devide the sum of actual sales   by 15 because we have 15 periods.

How can I do that?

Thank you,

Alâa Eddine

5 Replies
ogautier62
Specialist II
Specialist II

Hi,

if you use avg(Sales) as expression you'll have the correct result for subtotal Product

regards

Anonymous
Not applicable
Author

Hello,

thank you for your answer.

I tried that but it does not work correctly.

I show you what i have:

aa.PNG

For the product "ADAVNCE", for example if we do the sum we will find 9 products in total on 5 periods so the average will be 9/5.

This is what i want to calculate.

vvv.PNG

dapostolopoylos
Creator III
Creator III

Can you provide a sample document so we can play around with it,in order to find a solution?

Father/Husband/BI Developer
sasikanth
Master
Master

Try below exp,

Sum(ActualSales)/Count(Year Month)

Anonymous
Not applicable
Author

Hello,

i tried but the calculation was incorrect.

Any other ideas, please?