Newer Version Available
Last Day in the Week, Month, Quarter, or Year
Returns the date of the last day in the specified week, month, quarter, or
year.
Usage
Use these functions in a foreach() statement. You cannot use them in group by, order by, or filter statements.
week_last_day(date)
Returns the
date of the last day of the week for the specified date.
1q = foreach q generate week_last_day(toDate('Close_Date_sec_epoch')) as 'Week Last Day';year_last_day(date)
Returns the date of the last day of the year for the specified date.
1q = foreach q generate year_last_day(toDate('Close_Date_sec_epoch')) as 'Year last day';month_last_day(date)
Returns the date
of the last day of the month for the specified
date.
1q = foreach q generate month_last_day(toDate('Close_Date_sec_epoch')) as 'Month Last Day';quarter_last_day(date)
Returns the
date of the last day of the quarter for the specified
date.
1q = foreach q generate quarter_last_day(toDate('Close_Date_sec_epoch')) as 'Quarter Last Day';