2 Replies Latest reply: May 8, 2012 1:52 AM by Vincent Ardiet

# How i filter the expression with min and max

Hello everybody.

I have an expresion similar that  =sum({<year = {2011,2010}>} profit)

I need sum the profit only a years different from the max of year in this case 2012

If i write =sum({<year={\$(=max(year))} profit) run and sum the [profit for the max of year but shows error if i replace the = for the << for given the sum of years that are minor of 2012.

How i write the expresion ?

=sum({<year << \$(=max(year))>} profit) shows error.

Thanks in advance.

• ###### How i filter the expression with min and max

Hi,

I don't know if I understood your question correctly, so tell me if im wrong okay?^^

For example you have years 2010, 2011, and 2012

do you want to sum the profit of all years (in this case 2010 AND 2011) that are < to your max year(which is 2012)?

if so, can you try this?

sum({<year = {"<\$(=max(year))"}>}profit)

or do you want to know only the profit of last year (2011) base on your max year (2012)?

if this is the case then you can try this instead^^

sum({<year = {\$(=max(year)-1)}>}profit)

Best Regards,

Alex

• ###### Re: How i filter the expression with min and max

Hi,

You can exclude the max year with a minus preceding the equal :

=sum({<year -= {\$(=max(year))} profit)

Regards,

Vincent