Page 1 of 1

switching data entry options

Posted: Thu Jul 09, 2009 9:23 pm
by tzallgoood
I am relatively new to SD and vensim. I have figured out how to define variables, read in data from a spreadsheet, etc. Is there a way to switch between reading in the data from the spreadsheet to allowing the user to set the value with a slider.

I was thinking about using IF THEN ELSE:

Variable 1[subscript1, subscript2] =
IF THEN ELSE(switch=1,
GET XLS CONSTANTS('*.xls','Sheet1','B2'),
GAME (50))

I am having trouble getting it to work. Am I on the right track? Is there a better way?

Thanks

Posted: Fri Jul 10, 2009 9:30 am
by bob@vensim.com
GAME need to appear first on the right so you need

var1 = IT THEN ELSE(switch=1,const from spreadsheet,var from user)
const from spreadsheet = GET XLS CONSTANTS('test.xls','Sheet1','B2')
var from user = GAME (50)

That is, just break up what you are doing into multiple equations.