### several if statements

Posted:

**Wed Nov 22, 2017 3:41 pm**Hi,

I am trying to create a simple series "of_cus_2_dir" based on if statements on the values of another series "of_cus_2_sum". The "of_cus_2_dir" series should then contain 1, 0 and -1 only. Is this possible without having created the "of_cus_2_dir" series in advance?

wfopen C:\Users\xlianj\Dropbox\OTC\Data\Eviews\sekeur_daily

'wfopen ..\Eviews\SEKEUR

'wfopen SEKEUR_daily

if of_cus_2_sum >0 then of_cus_2_dir =1

and

if of_cus_2_sum =0 then of_cus_2_dir =0

and

if of_cus_2_sum <0 then of_cus_2_dir =-1

endif

What is wrong?

Could I do this drectly in the series window by generate series by equation?

Best,

Anna

I am trying to create a simple series "of_cus_2_dir" based on if statements on the values of another series "of_cus_2_sum". The "of_cus_2_dir" series should then contain 1, 0 and -1 only. Is this possible without having created the "of_cus_2_dir" series in advance?

wfopen C:\Users\xlianj\Dropbox\OTC\Data\Eviews\sekeur_daily

'wfopen ..\Eviews\SEKEUR

'wfopen SEKEUR_daily

if of_cus_2_sum >0 then of_cus_2_dir =1

and

if of_cus_2_sum =0 then of_cus_2_dir =0

and

if of_cus_2_sum <0 then of_cus_2_dir =-1

endif

What is wrong?

Could I do this drectly in the series window by generate series by equation?

Best,

Anna