3 Replies Latest reply: Apr 17, 2010 8:21 PM by Oleg Troyansky

# Calculating max and min value from a calculated expression

Hi

So happy to have this community which has already helped me with problems. No I have a new one. Will try to explain this in an example:

I have information from a company which includes articles, revenue and quantity. From this I have calculated the price of each article in a new expression and I have put it in a new column. Now I would like to calculate the max and min value of the price. How do I do this?

Thanx - really appreciating the help.

• ###### Calculating max and min value from a calculated expression

hi,

you can create max(price) and min(price) as new columns

thanks

• ###### Re. :Re: Calculating max and min value from a calculated expression

Or without creating a new column just do Min (Revenue/quantity) and Max (Revenue/quantiy)

• ###### Calculating max and min value from a calculated expression

I'm guessing that you need to find the min and max of the calculated price by article... In order to do that, you need to use Advanced Aggregation function aggr(). Something like the following:

Min( AGGR( sum(Revenue)/sum(Quantity), Article) )

Function AGGR() will aggregate your Expression by Article, and then the resulting array of numbers can be aggregated again with Min or Max.