## Level 2 Model Building/ 2.4.7 Activity

Regular Contributor

## Level 2 Model Building/ 2.4.7 Activity

Hi,

Having a hard time figuring out how to write a formula for Line Item forecast cf in Module DEM03 Demand Forecast. The instructions are below.

Write a formula for the line item:

• If Initial Demand Forecast is EQUAL to the Final Forecast, set value of Forecast cf to 0.
• If Initial Demand Forecast is NOT EQUAL to the Final Forecast, set value of Forecast cf to 1.

I was thinking about using a IF THEN statement, but theses line items are all have Number Formatting and not Boolean.

Thank you

Master Anaplanner/Community Boss

## Re: Level 2 Model Building/ 2.4.7 Activity

Hello @neg177

You are on the right track with the IF statement. It is as easy as it sounds.
IF statements are not limited to boolean data type, the IF statement can return number, text, even a list member.

What's important is that the condition you put for the IF portion resolves to TRUE or FALSE

Here are some examples

IF 1+2 = 3  ==> TRUE

Line Item First Name, Text, value is Einas

IF First Name = "Mike" ==> FALSE

L

Einas
"Give a Man a Fish, and You Feed Him for a Day. Teach a Man To Fish, and You Feed Him for a Lifetime"