How to add multiple if then else statements in vensim

159 Views Asked by At

I have this logic in vensim that goes,

If result<150, 1,2
if result>=150 :AND: <200, 3, 4
If result > 200, 5, 6

What I want is to make them nested if in vensim, but I do not know how.

I already tried

If then else (result<150, 1, If then else (result>=150:AND:<200,3, 2))

but it doesnt work. please help

1

There are 1 best solutions below

0
On

The easiest thing to do is this.

calculation = if then else ( result < 150 , 1 , 0 )

  • if then else ( result >= 150 :and: result < 200 , 2 , 0 )
  • if then else ( result > 200, 3, 0 )

I'd also remove the numbers (150 etc) and make them constants with units. It will make your model easier for others to understand.