3 Replies Latest reply: Jul 16, 2013 2:04 AM by Gysbert Wassenaar

# Minimum, maximum and average price per unit?

I have attached profit of every shipment.

i want a column to show the minimumm average and maximum sales price per unit of each and every part no.

Can anyone help me with this, please?

• ###### Re: Minimum, maximum and average price per unit?

I'm guessing that you want the max, min and average aggregated over ILENo. That would give expressions like:

max(aggr(sum({<[Entry Type] = {1} >}[Sales Amount (Actual)])/Count({<[Entry Type] = {1} >}Quantity),ILENo))

min(aggr(sum({<[Entry Type] = {1} >}[Sales Amount (Actual)])/Count({<[Entry Type] = {1} >}Quantity),ILENo))

avg(aggr(sum({<[Entry Type] = {1} >}[Sales Amount (Actual)])/Count({<[Entry Type] = {1} >}Quantity),ILENo))

• ###### Re: Minimum, maximum and average price per unit?

Dear Gysbert,

i am not getting the correct answer for this.

pls see the atatchment. i have copied your formula, i want the maximum sales price per unit.

for eg, when i select a particular item no. all shipments of that item is displayed. it shows the per unit sales price and cost price for all shipments. i want the maximum and minimum price of that item.

• ###### Re: Minimum, maximum and average price per unit?

Try aggregating over Document No_ instead: max(aggr(sum({<[Entry Type] = {1} >}[Sales Amount (Actual)])/Count({<[Entry Type] = {1} >}Quantity),[Document No_]))