Page 1 of 1

multiple conditions

Unread postPosted: Sat Sep 25, 2021 8:22 am
by akk
I want to set the value of a series based on whether 6 conditions are simultaneously true. (This involves the absolute value of various lags of the series falling into various ranges.) I was going to use a loop, but don't see how I can string together all the conditions.

I am hoping there is some version of

if ( abs(x) < ZZ and abs(x-1) > QQ and ....)
set y = 1
else
set y= 0
Thanks

Re: multiple conditions

Unread postPosted: Wed Oct 20, 2021 10:59 am
by TomDoan
The logic has to be inside the SET expression:

set y = (abs(x)<zz.and.abs(x-1)>qq.and.other conditions)

The value of Y will be 1 if all the AND conditions are met and 0 otherwise.