5 Replies Latest reply: Jun 30, 2016 3:55 AM by Daniel Ansell

# Help with a formula

I need, if it possible to write a formula, with this procedure,  I have a field called YEAR, so if this field is filtered (like I choose only data from 2015) then the formula must return year selected minus one (then 2014).   But if YEAR is not filtered then must return CURRENT year minus one.

Is this possible? can you help me

• ###### Re: Help with a formula

May be this:

Max(YearField) - 1

Replace YearField with your actual Year Field Name here

• ###### Re: Help with a formula

Hi Claus

If i understand correctly this might be what you're looking for:

if(GetSelectedCount(Year)=1,sum({<Year={'\$(=GetFieldSelections(Year)-1)'}>}UNITS),sum({<Year={'\$(=max(Year)-1)'}>} NITS))

Thanks

Dan

• ###### Re: Help with a formula

Sunny's idea works better, mine was to complicated

so full formula would have been:

sum({<Year= {'\$(=max(Year)-1)'}>}UNITS)

• ###### Re: Help with a formula

both answers work fine, thanks

• ###### Re: Help with a formula

Hi Claus

Please mark an answer as correct so its helpful for other users in the community.

Thanks

Dan