Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I think the AND and OR within the last two if-loops aren't correct defined - they need be appropriate wrapped with brackets to ensure the right order of execution.
Beside this an extra wrapping of a function doesn't improved the readability and the if-query to TEST_RESULT is redundant and could shortened. Further such a construct could be simplified by applying a multi-stage approach within a preceeding-load, means something like:
load *, if(match(X, 5, 6), 'x', 'y') as Y;
load *, num(weekday(RESULT_DATE)) as X
from Y;
- Marcus