Register

Contributor

## How to "do nothing"?

I have a situation where if a given condition is met I want to take action, but if it is not met, I don't want to do anything.  The line item is of type number and setting it to 0 is not a viable option for the ELSE side.  So how can I code "do nothing"?

11 REPLIES 11
Contributor

## Re: How to "do nothing"?

Create a new line item for this!

For example, say the original line item is A and the "action" taken if condition is met is to multiply it by 50

B= IF [condition] THEN A*50 ELSE A
Contributor

## Re: How to "do nothing"?

Thanks for the quick response.  I'm trying to do this without adding a line item but I can certainly see how your solution would work.

Contributor

## Re: How to "do nothing"?

Hey, yeah I'm afraid you can't reference a line item in its own formula, it's circular referencing which can't be done in Anaplan. You need another line item if you want to manipulate the data 🙂
Contributor

## Re: How to "do nothing"?

What type of condition are you applying, is it based on another line item or the result of the formula you're writing?
Contributor

## Re: How to "do nothing"?

It is based on another line item (boolean) and the action taken when true also involves another numeric line item.

Contributor

## Re: How to "do nothing"?

And just so I understand, why wouldn't
IF Boolean.lineitem = false THEN 0 ELSE numeric.lineitem x 50?

work?

Contributor

## Re: How to "do nothing"?

The action I'm using is POST and since multiple time period can post to the same cell, 0 will override an existing value and I don't want that.

Moderator

## Re: How to "do nothing"?

@dngingras I'm trying to think through the use case on this but I think I understand what you're trying to do.

I like @cianna.bramley and @CommunityMember83188 where you use a boolean, preferably from a system module (DISCO methodology)

But if you don't want to add another line item -

You can try using LEAD on the ELSE portion the same distance as the post. This will leave the value alone if it doesn't meet your condition.

For example,

IF Sales < 150 THEN POST(Sales, 2) + 100 ELSE LEAD(Sales, 2, 0)

Jared Dolich
Contributor

## Re: How to "do nothing"?

In your example, the Jun value should be 230 but the LEAD function overwrite that value with the Aug Sales value.  I actually got it to work by changing the logic of the line item I'm posting so that if the condition is not met, that line item becomes 0 and then the POST function gives the proper numbers.

Thank you all for your suggestions, much appreciated.