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

Ave Function

Hi everyone!

I would like to Cost by Sale ratio for every main account, my scenario is something like this;

   

yearmonthmain accountcostsales
20171100120800
20172100125820
20173100130845
2017410095700
20175100124810
20176100132825
20177100145845
20178100127801
20179100135850
201710100128825
201711100160900
201712100140890

how to right below expressions in a straight table?

   

cost/Sales%WA%diff from WA%
15%16%-1%
15%16%0%
15%16%0%
14%16%-2%
15%16%0%
16%16%0%
17%16%1%
16%16%0%
16%16%0%
16%16%0%
18%16%2%
16%16%0%
3 Replies
Anonymous
Not applicable
Author

Sorry to compute Cost by Sale ratio

sunny_talwar

This

Capture.PNG

Expressions

=Sum(cost)/Sum(sales)

=Avg(TOTAL Aggr(Sum(cost)/Sum(sales), year, month))

=Column(1) - Column(2)

sunny_talwar

The second expression might change if you need a total average by main account

=Avg(TOTAL <[main account]> Aggr(Sum(cost)/Sum(sales), year, month))