# 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
Did you mean:
Highlighted
Creator

## Ave Function

Hi everyone!

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

 year month main account cost sales 2017 1 100 120 800 2017 2 100 125 820 2017 3 100 130 845 2017 4 100 95 700 2017 5 100 124 810 2017 6 100 132 825 2017 7 100 145 845 2017 8 100 127 801 2017 9 100 135 850 2017 10 100 128 825 2017 11 100 160 900 2017 12 100 140 890

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

## Re: Ave Function

Sorry to compute Cost by Sale ratio

Highlighted
MVP

## Re: Ave Function

This

Expressions

=Sum(cost)/Sum(sales)

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

=Column(1) - Column(2)

Highlighted
MVP

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