Page 1 of 1

Replacing Tabbed Arrays to avoid "hard-coding"

Posted: Tue Nov 14, 2023 6:29 am
by Ashish_Kumar
I have a working model which uses Tabbed Arrays. I've pasted an example below. I would like to revise the model to read data from an Excel file instead. The variable being defined does not vary with time; it depends on two subscript variables, "Age" and "Gender".

I tried using GET XLS LOOKUP and got an error. Before spending more time on this, I would like to ask: what is the simplest way to achieve my aim? I want to avoid having the numbers hard-coded into the model, to make them easier to change.


age specific mortality rate[Female, Age]=TABBED ARRAY(
0.00201 0.00201 0.00014 0.00014 0.00013 0.00012 0.00011 0.00011 0.0001 0.0001
9e-05 9e-05 9e-05 9e-05 0.0001 0.00011 0.00012 0.00013 0.00014 0.00016 0.00017
0.00019 0.0002 0.00021 0.00021 0.00021 0.0002 0.0002 0.0002 0.00022 0.00023
0.00025 0.00027 0.00029 0.00031 0.00034 0.00038 0.00041 0.00045 0.00049 0.00055
0.0006 0.00066 0.00073 0.00082 0.00092 0.00103 0.00114 0.00126 0.00141 0.00157
0.00173 0.0019 0.00208 0.00228 0.00249 0.00271 0.00294 0.00321 0.00354 0.00391
0.00428 0.00469 0.00521 0.00591 0.00672 0.00757 0.00844 0.00939 0.01047 0.0116
0.01274 0.01399 0.01559 0.01773 0.02019 0.02273 0.02536 0.02835 0.03188 0.03571
0.03958 0.04358 0.04822 0.05406 0.06105 0.06837 0.07641 0.08522 0.09487 0.1054
0.11685 0.12928 0.14273 0.15723 0.17283 0.18956 0.20744 0.22648 0.24669 0.26809
1
)

Re: Replacing Tabbed Arrays to avoid "hard-coding"

Posted: Tue Nov 14, 2023 7:31 am
by Administrator
GET XLS CONSTANTS should do what you want.

https://www.vensim.com/documentation/fn ... +constants

Re: Replacing Tabbed Arrays to avoid "hard-coding"

Posted: Wed Nov 15, 2023 1:33 am
by Ashish_Kumar
Thank you. That works fine.