X IF MISSING / IF THEN ELSE

Use this forum to post Vensim related questions.
Post Reply
EstebanD
Junior Member
Posts: 3
Joined: Tue Mar 12, 2024 12:59 pm
Vensim version: DSS

X IF MISSING / IF THEN ELSE

Post by EstebanD »

Hi, just a quick question: which function is more efficient between X IF MISSING and IF THEN ELSE in terms of calculation time?
As I understand it, if we consider two variables A and B, X IF MISSING(A,B) and IF THEN ELSE(A=:NA :,B,A) will give the same result. In this case, is it better to use one expression rather than the other?
Thank you for your answer.
Administrator
Super Administrator
Posts: 4849
Joined: Wed Mar 05, 2003 3:10 am

Re: X IF MISSING / IF THEN ELSE

Post by Administrator »

Probably X IF MISSING. Data variables are calculated only once before a simulation starts, so if you are running sensitivity/optimization, X IF MISSING will execute once, the IF THEN ELSE will execute every time the model is run.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
tomfid
Administrator
Posts: 4006
Joined: Wed May 24, 2006 4:54 am

Re: X IF MISSING / IF THEN ELSE

Post by tomfid »

X IF MISSING is also more convenient if you have multiple data inputs in the equation.
Post Reply