Hi,
Does anyone know if it is possible to pass the subscript name as a string parameter so I can get a value for each subscript item from different sheets in Excel?
I´m looking for something like:
GET XLS CONSTANTS('DadosORCPRs.xlsx', [PRs], 'B2' )
The idea is that each value comes from a sheet with the same name of the subscript item.
Thanks
Get Subscript Constants from different sheets
Re: Get Subscript Constants from different sheets
Using a string variable should work. Something like:
Sheet : (sheet1-sheet3)
Sheet name[sheet1] :IS: 'fred'
Sheet name[sheet2] :IS: 'bob'
Sheet name[sheet3] :IS: 'mary'
myval[sheet] = GET XLS CONSTANTS( 'filename', sheet name[sheet], 'a1' )
Sheet : (sheet1-sheet3)
Sheet name[sheet1] :IS: 'fred'
Sheet name[sheet2] :IS: 'bob'
Sheet name[sheet3] :IS: 'mary'
myval[sheet] = GET XLS CONSTANTS( 'filename', sheet name[sheet], 'a1' )
/*
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
*/
Re: Get Subscript Constants from different sheets
Thanks for your answer.
I´m trying using a string variable that gets the subscripted values also from excel but I´m getting an error.
The model is attached. The string variable with the error showing is "PRsstr"
Thanks!
I´m trying using a string variable that gets the subscripted values also from excel but I´m getting an error.
The model is attached. The string variable with the error showing is "PRsstr"
Thanks!
- Attachments
-
- OrcSubscript.mdl
- (2.85 KiB) Downloaded 168 times
Re: Get Subscript Constants from different sheets
Ah ... you can't use GET XLS to retrieve strings. They have to be in the model. You can put a default value in the equation and supply overrides in a .cin file however.
/*
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
*/
Re: Get Subscript Constants from different sheets
Also, you forgot the subscript on the uses of PRsstr.
"%Orc 2341 PR"[PRs]=
GET XLS CONSTANTS('DadosORCPRs.xlsx', PRsstr[PRs], 'B2' )
"%Orc 2341 PR"[PRs]=
GET XLS CONSTANTS('DadosORCPRs.xlsx', PRsstr[PRs], 'B2' )
/*
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
*/
Re: Get Subscript Constants from different sheets
Thanks I lot, Ill try it.
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
Re: Get Subscript Constants from different sheets
Please enter your serial number in your profile. Entering incorrect information usually ends up in a ban.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559