1 Reply Latest reply on May 22, 2018 1:37 PM by Esther Aller

# The most recent value...with condition..HELP ME!!!

IF [value1] < LOOKUP([value2], -100) THEN

LOOKUP([value2], -100)

ELSEIF [value1] < LOOKUP([value2], -99) THEN

LOOKUP([value2], -99)

ELSEIF [value1] < LOOKUP([value2], -98) THEN

LOOKUP([value2], -98)

ELSEIF [value1] < LOOKUP([value2], -97) THEN

LOOKUP([value2], -97)

ELSEIF [value1] < LOOKUP([value2], -96) THEN

LOOKUP([value2], -96)

ELSEIF [value1] < LOOKUP([value2], -95) THEN

LOOKUP([value2], -95)

ELSEIF [value1] < LOOKUP([value2], -94) THEN

LOOKUP([value2], -94)

ELSEIF [value1] < LOOKUP([value2], -93) THEN

LOOKUP([value2], -93)

ELSEIF [value1] < LOOKUP([value2], -92) THEN

LOOKUP([value2], -92)

...

...

...

...

ELSEIF [value1] < LOOKUP([value2], -2) THEN

LOOKUP([value2], -2)

ELSEIF [value1] < LOOKUP([value2], -1) THEN

LOOKUP([value2], -1)

END

• ###### 1. Re: The most recent value...with condition..HELP ME!!!

Hi,

To help more we would need to know what is wrong. From just looking at the calculation, it appears you may be missing aggregations as LOOKUP() requires an aggregated input. However if [value1] and [value2] are calculated fields returning aggregated output, then adding extra aggregations will not be necessary.

If you do need to add aggregations, it could look like:

IF MIN([value1]) < LOOKUP(MIN([value2]), -100) THEN

LOOKUP(MIN([value2]), -100)

If that is not your issue, please provide some more details. A packaged workbook is also always helpful!