Importing time series data from a textfile

Use this forum to post Vensim related questions.
Post Reply
Quame
Member
Posts: 26
Joined: Tue Mar 12, 2019 7:37 pm
Vensim version: DSS

Importing time series data from a textfile

Post by Quame » Fri May 31, 2019 8:46 pm

Dear All,

I have a number of time series data in a text file that I want to use to drive my model model. My plan had been to import the data and create a vdf file
from which I would use the 'GET VDF DATA' function to get the data. I am forced to import from a text file because Excel cannot be installed on the server I am working on. I am getting errors using the 'GET VDF DATA' function because I have not been successful in introducing a variable name in the text file that can be reference as an argument in the function. Kindly assist. Attached is an example of the file in excel.
Attachments
TS_data.xlsx
(37.64 KiB) Downloaded 6 times

tomfid
Administrator
Posts: 2590
Joined: Wed May 24, 2006 4:54 am

Re: Importing time series data from a textfile

Post by tomfid » Fri May 31, 2019 10:01 pm

GET VDF DATA is for retrieving a value from a Vensim dataset, not a text file. I think you want to use either the GET DIRECT DATA function, or import the dataset from text to VDF. GET VDF DATA is rarely needed.

Quame
Member
Posts: 26
Joined: Tue Mar 12, 2019 7:37 pm
Vensim version: DSS

Re: Importing time series data from a textfile

Post by Quame » Fri May 31, 2019 11:00 pm

Okay thanks for the reply. I tried that, but the issue I had was with respect to the arguments. The function has the arguments "GET DIRECT DATA( {'filename'} , {'tabname'} , {'time_row_or_col'} , {'first_data_cell'} )". In the text file, how do I reference ,tabname, time row or col, and first data cell? This is easy to do in excel or csv but not text file

tomfid
Administrator
Posts: 2590
Joined: Wed May 24, 2006 4:54 am

Re: Importing time series data from a textfile

Post by tomfid » Sat Jun 01, 2019 12:39 am

Check the sample models in the help system. For ext files, the tab name field is used for the delimiter.
http://vensim.com/documentation/fn_get_direct_data.htm

tomfid
Administrator
Posts: 2590
Joined: Wed May 24, 2006 4:54 am

Re: Importing time series data from a textfile

Post by tomfid » Sat Jun 01, 2019 12:40 am

You reference the rows and columns with the same notation as if it were an Excel file.

Quame
Member
Posts: 26
Joined: Tue Mar 12, 2019 7:37 pm
Vensim version: DSS

Re: Importing time series data from a textfile

Post by Quame » Sat Jun 01, 2019 4:56 pm

Okay thanks

Post Reply