Page 1 of 1

Date Function

Posted: Fri May 16, 2014 4:04 pm
by rmoralesaramburu
Hello,

I have a problem, I have a series with daily frequency, I would like to fill a vector with only the "Fridays observations" (@weekday=5) and the @last observation. When I smpl if with @weekday=5, I have the problem that if today it is NOT Friday, I will miss the Today observation.

Thanks!!

Re: Date Function

Posted: Fri May 16, 2014 4:45 pm
by EViews Gareth
smpl if @weekday=5 or @date = @datefloor(@now, "d")

or something like that.

Re: Date Function

Posted: Mon May 19, 2014 7:55 am
by rmoralesaramburu
Take a look at my solution, is there an easy way to do it?

vector(7) v_z_eem

v_z_eem(1)=@last(z_eem_pc)

smpl @last-@weekday @last-@weekday if @weekday=5
v_z_eem(2)=@last(z_eem_pc)

smpl @last-(@weekday+5) @last-(@weekday+5) if @weekday=5
v_z_eem(3)=@last(z_eem_pc)

smpl @last-(@weekday+10) @last-(@weekday+10) if @weekday=5
v_z_eem(4)=@last(z_eem_pc)

smpl @last-(@weekday+15) @last-(@weekday+15) if @weekday=5
v_z_eem(5)=@last(z_eem_pc)

smpl @last-(@weekday+20) @last-(@weekday+20) if @weekday=5
v_z_eem(6)=@last(z_eem_pc)

smpl @last-(@weekday+25) @last-(@weekday+25) if @weekday=5
v_z_eem(7)=@last(z_eem_pc)