How do I read in daily data with gaps and missing data?
Posted: Tue Sep 08, 2015 2:05 pm
I have an Excel spreadsheet (example.xlsx) that contains daily data for certain dates. My goal is to read the series into a daily time series, with only the dates that have data in the file filled in. All other values should be missing, since there isn't any data for those dates in the file. Using this code
I get this output
which doesn't look right at all. The output should only have data for the two dates in the file, and no others. Is there an option I'm missing?
Code: Select all
calendar(d) 1999:01:01
allocate 50 2020:01:01
open data example.xlsx
data(format = xlsx, org = columns, nolabels, sheet = "ffr", top = 2) / s13 s14
close data
print / s13 s14
Code: Select all
ENTRY S13 S14
2010:12:20 1 3
2010:12:21 1 3
2010:12:22 1 3
2010:12:23 1 3
2010:12:24 1 3
2010:12:27 1 3
2010:12:28 1 3
2010:12:29 1 3
2010:12:30 1 3
2010:12:31 1 3
2011:01:03 NA NA
2011:01:04 2 4
2011:01:05 2 4
2011:01:06 2 4
2011:01:07 2 4
2011:01:10 2 4
2011:01:11 2 4
2011:01:12 2 4
2011:01:13 2 4
2011:01:14 2 4
2011:01:17 2 4