Page 1 of 1

If statement question

Posted: Thu Mar 18, 2010 5:25 pm
by Akavall
Hello,

I tried to run this code

Code: Select all

if 10 < index(!i,1) <= 20 then zz(!i,1) = X(!i,1) else zz(!i,1) = na endif
I am trying to tell EViews that index(!i,1) should be between 10 and 20, but it seems to treat my command as just "10 < index(!i,1". What would be the proper way to write this code?

Thank You in advance.

Re: If statement question

Posted: Thu Mar 18, 2010 7:00 pm
by startz
Try something like

Code: Select all

if 10 < index(!i,1) and index(!i,1) <= 20 then

Re: If statement question

Posted: Thu Mar 18, 2010 8:01 pm
by Akavall
Yes. This works. Thank You Very Much!