Array

Use this forum to post Vensim related questions.
Post Reply
pochoa
Junior Member
Posts: 8
Joined: Mon Mar 15, 2004 1:54 pm

Array

Post by pochoa »

I have a 2 dimensional subscripted variable
Offer[Price,Quantity]
I need to sort it by Price and then I need to read the Quantity corresponding to each of the ordered Price.
I don't know how to fill the variables for the two dimensions, and I don't know how to call the value of the quantity relating to a price.
Thanks
Pruyn
Senior Member
Posts: 80
Joined: Fri Mar 05, 2004 2:34 pm

Post by Pruyn »

If I get your Idea right, it sounds more like you need a lookup or other one-to-one funcion.
But to answer part of your question. To input 2-dimensional arrays use comma's to separate the first set of values for quantity, then use a ; to input the next set of values corresponding to quantity and the second price. (1,2,3;1,2,3; ). But all this is in the manual under subscripts.
As far as I know it is only possible to order by the last subscript, so you should change their order.

[Edited on 17-3-2004 by Pruyn]
pochoa
Junior Member
Posts: 8
Joined: Mon Mar 15, 2004 1:54 pm

Post by pochoa »

Thanks Pruyn, But what I need is to fill the 2 dimensional array with variables, not with constant values, so the structure with 1,3,4;5,6...does not work.
For 1 dimension I use multiple equations, but I don't know how to fill in the variable for the second dimension
Administrator
Super Administrator
Posts: 4827
Joined: Wed Mar 05, 2003 3:10 am

Post by Administrator »

Can you give an example of what you have (vensim variables) and what you need? I am sure it is easy, just need to see what variable types you are using.

Tony.
Post Reply