Hi!
I have an Excel sheet containing export streams from one region to another on different time dates (// indicate new column, --- indicate new row).
From// To // 2018// 2019// 2020---
USA// Germany// 0// 10// 20---
USA// China// 10// 20// 30---
USA// USA// 0// 0// 0//
Germany// USA// 5// 10// 20---
Germany// China// 5// 5// 5---
Germany// Germany// 0// 0// 0---
China// USA// 10// 15// 20---
China// Germany// 10// 5// 0---
China// China// 0// 0// 0---
My wish would be that I create a variable in Vensim, that is able to display this array as well. I defined two subscripts:
Subscript 1 (ExportCountries): USA, Germany, China
Subscript 2 (ImportCountries): USA, Germany, China
But I always failed that the variable ExportStream[ExportCountries,ImportCountries] is able to display this time-dependent array in Vensim as well.
Can you please help me how to read in multiple arrays from Excel into Vensim?
Thanks in advance,
Sandra
Read in time-dependent array from Excel
Read in time-dependent array from Excel
- Attachments
-
- Problem.xlsx
- (8.97 KiB) Downloaded 144 times
Re: Read in time-dependent array from Excel
If you're using GET XLS, it can only handle one dimension (plus time) at a time. So, you'd need three equations to import this:
data[USA,importCountries] = GET XLS DATA( ... , 'C5' )
data[Germany,importCountries] = GET XLS DATA( ... , 'C8' )
data[China,importCountries] = GET XLS DATA( ... , 'C11' )
(Also check the sample model in the Help system, linked to the GET XLS DATA topic.)
For this kind of thing, it may be easier to import the data to a .vdf - you just need to get your input data into an appropriate format - for example:
data[USA,importCountries] = GET XLS DATA( ... , 'C5' )
data[Germany,importCountries] = GET XLS DATA( ... , 'C8' )
data[China,importCountries] = GET XLS DATA( ... , 'C11' )
(Also check the sample model in the Help system, linked to the GET XLS DATA topic.)
For this kind of thing, it may be easier to import the data to a .vdf - you just need to get your input data into an appropriate format - for example:
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/