# QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

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

3 Replies

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

talk is cheap, supply exceeds demand
Not applicable

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

talk is cheap, supply exceeds demand