importing data with multiple subscripts - can I do it?

Use this forum to post Vensim related questions.
Post Reply
soniav
Junior Member
Posts: 2
Joined: Thu Oct 02, 2008 7:20 pm

importing data with multiple subscripts - can I do it?

Post by soniav »

Hi,
We're working with variables multiple subscripts and large amounts of data, and I'm wondering if there's a way to import data using more than just two subscripts. For example, say we have "ownership by capita", with three subscripts: [city, vehicle, community], and I'm trying to get the following data table (totally random values, but you get the idea), is it possible to do it? I tried GET XLS CONSTANTS('Model data.xls','Sheet 1', 'c3' ), but it doesn't seem to like the addition of a third subscript. Is there another way to do this? Just to give you an idea, I'm looking at data broken down by about six or seven subscripts.

Rural urban suburb
Toronto car 0.877 0.492 0.465
Toronto truck 0.056 0.198 0.933
Toronto van 0.803 0.900 0.883
Miami car 0.496 0.926 0.853
Miami truck 0.398 0.456 0.456
Miami van 0.346 0.234 0.044
Tokyo car 0.647 0.524 0.202
Tokyo truck 0.332 0.822 0.522
Tokyo van 0.107 0.583 0.025



Any advice or assistance you can provide would be greatly appreciated,

Sonia
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

Just looking at this it appears to be constants and not data. In either case you will not be able to use GET XLS calls. If you set up data in the form

Time 0 1 2
var1 a1 b1 c1 d1 1 2 3
var1 a1 b1 c1 d2 2 3 4

and so on then import the spreadsheet and tell Vensim to look in columns 2,3,4,5 for subscripts that will work.

For constants you will need to put the variables into Vensim subscript format and then you can save that as a .csv file and specify that it be used to load changes.

If the data is not sourced from Excel you might look into ODBC. Another possibility is writing a Macro in Excel to creat .dat and .cin files.
Post Reply