Page 1 of 1
@wdrop statement
Posted: Fri Sep 23, 2016 1:07 pm
by Andre2016
Hello Guys,
So I have the following code :
Code: Select all
smpl @all
genr bbmodel = bbdmodel
alpha bbmodel
@wdrop ("Astra 1125SP" , "SP")
@wdrop ("Astra 1125SPX" , "SPX")
Is there a way to write it so that I don't have to revrite the @wdrop statement on every single line?
Thanks
Re: @wdrop statement
Posted: Fri Sep 23, 2016 1:47 pm
by EViews Gareth
Currently those lines are not doing anything, so hard so see what you mean.
Re: @wdrop statement
Posted: Mon Sep 26, 2016 11:23 am
by Andre2016
Currently those lines are not doing anything, so hard so see what you mean.
I have a series called "bbmodel" which is an alpha series that I'd like to edit.
In that alpha series I'd like the following action:
If what appears is "Astra 1125SP" then I'd like it to be only "Astra 1125"
If what appears is "Astra 1125SPX" then I'd like it to be only "Astra 1125"
Thanks
Re: @wdrop statement
Posted: Mon Sep 26, 2016 11:34 am
by EViews Gareth
Code: Select all
bbmodel = @replace(bbmodel, "SPX", "")
Re: @wdrop statement
Posted: Mon Sep 26, 2016 11:37 am
by Andre2016
Code: Select all
bbmodel = @replace(bbmodel, "SPX", "")
Thanks Gareth,
Re: @wdrop statement
Posted: Tue Oct 04, 2016 1:27 pm
by Andre2016
Code: Select all
bbmodel = @replace(bbmodel, "SPX", "")
I have an issue.
when I do
Code: Select all
bbmodel = @replace(bbmodel, "Falcon 200", "Falcon 20")
All the values containing "Falcon 200***" changes e.g:
Falcon 2000S becomes Falcon 200S
Is there a solution so that when I change "Falcon 200" to "Falcon 20", everything else remain the same ?
Thnks
Re: @wdrop statement
Posted: Tue Oct 04, 2016 2:01 pm
by EViews Gareth
If there are spaces after the 200, you could include a space in the replace.
Otherwise you'll have to do a search replace with @instr, @left, @mid etc...