Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator
Creator

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
Highlighted
Creator
Creator

Re: Ave Function

Sorry to compute Cost by Sale ratio

Highlighted

Re: Ave Function

This

Capture.PNG

Expressions

=Sum(cost)/Sum(sales)

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

=Column(1) - Column(2)

Highlighted

Re: Ave Function

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))