Page 1 of 1

I would like to get a SVECTOR or a STRING of all dates in sample

Posted: Wed Dec 05, 2018 2:13 pm
by leocaza
I would like to get a SVECTOR or a STRING of all dates in sample

For now I am doing this :

scalar tee = @rows(time)
freeze(time) usdcad
svector(@rows(time)) sampledate
for !i=10 to @rows(time)
sampledate(!i-9) = time(!i,1)
next
String sampledates = @wjoin(sampledate)

It is an "hack" to get the result done... but the code isn't clean enough for me.

Do you have a simpler way to do this ?

Thank you,
LC

Re: I would like to get a SVECTOR or a STRING of all dates in sample

Posted: Wed Dec 05, 2018 2:35 pm
by EViews Gareth

Code: Select all

alpha mydate = @datestr(@date, "YYYY/MM/DD") svector mydatesv = @convert(mydate)
Not sure what your code is doing, so I can't confirm this does the same thing, but it does what you said you wanted to do (create an svector with all dates in current sample).

Re: I would like to get a SVECTOR or a STRING of all dates in sample

Posted: Thu Dec 06, 2018 7:26 am
by leocaza
Thank you for that

Last question : Is there a way to convert a "Table" column into an alpha series or a SVECTOR or a string list ?

Thank you
LC

Re: I would like to get a SVECTOR or a STRING of all dates in sample

Posted: Thu Dec 06, 2018 8:23 am
by EViews Gareth
Not easily.