Page 1 of 1

Subscripts - GET XLS?

Posted: Wed Jun 21, 2006 10:17 am
by ESC
I am currently constructing a model, which reads in population data from an external source, as accurately modelling the population would be a lot of unnecessary work. One of the subscripts is Age Group, so when reading data in, I would have around 100 entries for each time period in the simulation, a total of 5000 entries (roughly). The standard, "hard work" approach would be to simply enter 100 equations into the variable Population, each for the specific subscript - i.E. for Age one, look here etc.

Is there a faster, easier way to do it?

Posted: Wed Jun 21, 2006 10:32 am
by bob@vensim.com
If this is not gender specific then just use

pop[AgeGroup] = GET XLS DATA('pop.xls','pop','1','B2')

where the spreadhseet has
time 1 2 3
under 5 8 9 6
5-10 3 4 2

and so on.

If it is also by Gender then you mght want 2 tabs, one for female and one for male and would need 2 equations.

Posted: Thu Jun 22, 2006 6:53 am
by ESC
Thanks a lot!

So if I have 3 subscripts, let's say Age Group, Gender and Country, I simply put in the required number of tabs, so for 3 countries and 2 genders it would be 6 with then 6 equations?

Posted: Thu Jun 22, 2006 12:29 pm
by bob@vensim.com
that's right.