Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
How can we put multilple conditions in where clause on load script. in below script i have to write two conditions in where clause like where CYEAR< year(today()) and CYEAR>year(Today())-3
load
V.SEGMENT as segment,
CYEAR as Year,
MARKET1 as Market,
Resident V
where CYEAR < year(Today())-3;
Where CYEAR >Year(Today())-3 and CYEAR< Year(Today())
Jagan,
i have tried with AND but its not working. is this because of resident load?
You can also enclose them in brackets if you need to add any 'or' statements at a later date
load
V.SEGMENT as segment,
CYEAR as Year,
MARKET1 as Market,
Resident V
where (CYEAR > year(Today())-3 and CYEAR < year(Today()) );
I would use brackets to separate the 2 conditons between "and"
where ((CYEAR>year(today()-3) and (CYEAR<year(today()))
Try to use like
Let vCurrYear = Year(Today());
Let vPrevYear = Year(Today())-3;
load
V.SEGMENT as segment,
CYEAR as Year,
MARKET1 as Market,
Resident V
where (( CYEAR > $(vPrevYear) ) and ( CYEAR < $(vCurrYear) ) );
Hope this helps
and works with resident load
where CYEAR > year(today()) - 3 and CYEAR < year(Today())
Try
CYEAR > (year(today()) -3) and ....