Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
i am trying to execute/Load below code in script but it gives me 'year field not found' error
From below code i am trying to get previous year Weekend_Group_Year.
LOAD
date(WeekEnd(CanonicalDate), 'MM-DD-YY') as Weekend_Group_Year
RESIDENT DateBridge WHERE Date(CanonicalDate, 'YYYY') = $(= max(Year-1));
Why is this giving me this error, if year is a function
Please help me on this.
what is ur date format?
You should calculate first the max year
LOAD
Max(Year) as m
Resident yourtable;
LET M=Peek('m');
LOAD
date(WeekEnd(CanonicalDate), 'MM-DD-YY') as Weekend_Group_Year
RESIDENT DateBridge WHERE Date(CanonicalDate, 'YYYY') = $(M);
Hi
has the field 'Year' found in the table DateBridge ?
otherwise you have to try like this ..
LOAD
date(WeekEnd(CanonicalDate), 'MM-DD-YY') as Weekend_Group_Year
RESIDENT DateBridge
WHERE Date(CanonicalDate, 'YYYY') = $(= max(Year((CanonicalDate))-1));
hi,
Yes year is found in datebridge