Giving Excel Data

Use this forum to post Vensim related questions.
Post Reply
sankee82
Member
Posts: 28
Joined: Mon Oct 01, 2018 5:56 pm
Vensim version: DSS

Giving Excel Data

Post by sankee82 »

When I am trying to give excel data to the variables of my model, it is giving an error that 'Simulation starts before first time for exogenous variable' and the table of that variable is not showing any values. Can you please help me with this?

Thanks and Regards,
Sankeerthana.
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Giving Excel Data

Post by tomfid »

This means that the time over which your data is available does not correspond to the time axis of the model. You will get that warning if, for example, your model starts in 1990 but your oil price data starts in 2010.
sankee82
Member
Posts: 28
Joined: Mon Oct 01, 2018 5:56 pm
Vensim version: DSS

Re: Giving Excel Data

Post by sankee82 »

Thank you so much. Can you please let me know how to make sure that the time period is same for both the model and data available?
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Giving Excel Data

Post by tomfid »

The model time is in Model>Settings>Time Bounds

The data time horizon will be in your spreadsheet. Model and data time units have to match. Excel dates generally won't work, because internally they are a number representing the days elapsed since Jan 1 1900.
sankee82
Member
Posts: 28
Joined: Mon Oct 01, 2018 5:56 pm
Vensim version: DSS

Re: Giving Excel Data

Post by sankee82 »

While giving GET XLS DATA command, the format is GET XLS DATA( {'filename'} , {'tabname'} , {'time_row_or_col'} , {'first_data_cell'} ) where time row/column is the row/column that stores the value of the variable. Then how is Vensim matching the units of the date as I am not providing any information regarding data?
Quame
Member
Posts: 26
Joined: Tue Mar 12, 2019 7:37 pm
Vensim version: DSS

Re: Giving Excel Data

Post by Quame »

tomfid wrote: Thu Mar 14, 2019 7:34 pm The model time is in Model>Settings>Time Bounds

The data time horizon will be in your spreadsheet. Model and data time units have to match. Excel dates generally won't work, because internally they are a number representing the days elapsed since Jan 1 1900.
Thanks tomfid. I am having similar issue, so how do you ensure that the dates in excel and model match?
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Giving Excel Data

Post by tomfid »

Two options:

1. Run the model in days, using the same numbering as Excel dates. (An Excel date is really a number like 34582.)

2. In Excel, create a time row/column that translates dates to a decimal year, week, etc. For example, if cell A2 contains a date, you could translate that to a decimal year via YEAR(a2) + MONTH(a2)/12.

#2 is usually preferred.
Quame
Member
Posts: 26
Joined: Tue Mar 12, 2019 7:37 pm
Vensim version: DSS

Re: Giving Excel Data

Post by Quame »

Okay thanks a lot
Post Reply