Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
First Day in the 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.
Use the functions whose names begin with week, month, quarter, and year with standard calendar year dates. Use the functions whose names begin with fiscal with fiscal year dates.
week_first_day(date)
1q = foreach q generate week_first_day(toDate('CloseDate_sec_epoch')) as 'Week First Day';fiscal_week_first_day(date)
1q = foreach q generate fiscal_week_first_day(toDate('CloseDate_sec_epoch')) as 'Fiscal Week First Day';month_first_day(date)
1q = foreach q generate month_first_day(toDate('CloseDate_sec_epoch')) as 'Month First Day';fiscal_month_first_day(date)
1q = foreach q generate fiscal_month_first_day(toDate('CloseDate_sec_epoch')) as 'Fiscal Month First Day';quarter_first_day(date)
1q = foreach q generate quarter_first_day(toDate('CloseDate_sec_epoch')) as 'Quarter First Day';fiscal_quarter_first_day(date)
1q = foreach q generate fiscal_quarter_first_day(toDate('CloseDate_sec_epoch')) as 'Fiscal Quarter First Day';year_first_day(date)
1q = foreach q generate year_first_day(toDate('CloseDate_sec_epoch')) as 'Year First day';fiscal_year_first_day(date)
1q = foreach q generate fiscal_year_first_day(toDate('CloseDate_sec_epoch')) as 'Fiscal Year First Day';