Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Calculate the average per category

Hi,

 

i was searching yesterday within the community for a solution but did not find anything that matches my case. If this was already discussed i would be glad if somebody can piont out the post.

 

I would like to calculate the average price for different categories. The difficulity is that i have rows with different quantities. Here an example

 

lineProdcut TypeqtyTotal price
Platform 1A15€ 61.51
Production lineProduct nameqtytotal price (not price per piece)

 

I don't know how i generate the correct calculation. I want to calculate the sum of total price and devide this by the sum of qty. 

 

Here is an excerpt of the table

 

lineProdcut TypeqtyPricePrice per piece
Platform 1A15€ 61.51€ 4.10
Platform 1B14€ 60.32€ 4.31
Platform 1G21€ 60.32€ 2.87
Platform 1G42€ 58.47€ 1.39
Platform 1J33€ 58.47€ 1.77
Platform 1W49€ 139.00€ 2.84
Platform 2J15€ 281.88€ 18.79
Platform 2Q27€ 143.39€ 5.31
Platform 2R13€ 57.04€ 4.39
Platform 2H8€ 57.04€ 7.13
Platform 2F12€ 93.04€ 7.75
Platform 2B20€ 206.89€ 10.34
Platform 2B35€ 207.36€ 5.92
Platform 2C25€ 126.34€ 5.05
Platform 2R24€ 126.34€ 5.26
Platform 3T39€ 131.94€ 3.38
Platform 3O2€ 138.16€ 69.08
Platform 3P47€ 56.24€ 1.20
Platform 3Y44€ 64.48€ 1.47
Platform 3W43€ 253.28€ 5.89
Platform 3R20€ 282.25€ 14.11
Platform 3D27€ 210.94€ 7.81

 

These are the average values that i would like to calculate:

 

LineTotal QtyTotal PriceAverage
Platform 1174€ 438.09 €      2.52
Platform 2179€ 1,299.32 €      7.26
Platform 3222€ 1,137.29 €      5.12

 

I am sure that there is a pretty easy solution which i did not consider. 

 

Thanks for you help!

  • Which calculations you have used.

    In case you have used this, hope you created it is a measure, not Column

     

    divide(sum(price),sum(qty))

     

    Please share the formula you created. It should be dynamic. Unless there is join missing.  Or Interactions are off.

     

5 Replies