Subscripts - GET XLS?

Use this forum to post Vensim related questions.
Post Reply
ESC
Member
Posts: 23
Joined: Thu Feb 10, 2005 10:45 am

Subscripts - GET XLS?

Post 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?
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post 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.
ESC
Member
Posts: 23
Joined: Thu Feb 10, 2005 10:45 am

Post 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?
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

that's right.
Post Reply