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!!
Date Function
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13585
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Date Function
smpl if @weekday=5 or @date = @datefloor(@now, "d")
or something like that.
or something like that.
-
rmoralesaramburu
- Posts: 52
- Joined: Mon Nov 18, 2013 9:09 am
Re: Date Function
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)
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)
Who is online
Users browsing this forum: No registered users and 2 guests
