# Using Min Function inside Where

Hello,

Using 4.1 SP4, I'm having trouble calculating something:

I have Item dims- Item Group, Item Size(code), and sellout quantity. (the data provider itself is more detailed but the table only shows the mentioned dimensions)

I would like to calculate for each Item group, the sellout quantity for the Minimum value of the size and divide by the sellout quantity for the maximum value.

The sizes are in codes, and are sorted (if value 9 is the minimum value, thats the value i want to calculate).

ex. If some item group has 3 sizes:

Item Group || Size || Size Code || Sellout

A || 1000ml || 10 || 10,000

A || 500ml || 9 || 7,000

A || 200ml || 4 || 5,000

I would like to calculate 5,000/10,000 (4 is the minimum value for size code, and 10 the is maximum value).

When I calculate

[Sellout] Where ([Size Code]=4) I get the "5,000",

but when I try [Sellout] Where ([Size Code]=Min([Size Code])

Does anyone have a suggestion how can i refrence the where to the value of the correct size code only.

Please your kind help.

Thank you,

Or