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.
regr_intercept()
1regr_intercept(field_y, field_x)field_y is a grouped dependent numeric expression and field_x is a grouped independent numeric expression. regr_intercept(field_y, field_x) uses simple linear regression to calculate the trend line. The input fields (field_y, field_x) must contain at least two pairs of non-null values. This function works with simple grouped values but not with cogroups.
Example - What Is the Likely Amount Won If the Number of Activities Is Zero?
Suppose that you have a dataset that includes the number of activities (such as meetings) and the won opportunity amount.

1q = load "Data";
2q = group q by all;
3
4--trunc() truncates the result to two decimal places
5q = foreach q generate trunc(regr_intercept('Amount', 'NumActivities'),2) as intercept;The projected deal size with no activities is $15.04 million dollars.
