DEFINE clause

DEFINE is used to generate an intermediate result that will not be included in the query result.

All EQL statements begin with either DEFINE or RETURN.

You can use multiple DEFINE clauses to make results available to other statements. Typically, DEFINE clauses are used to look up values, compare attribute values to each other, and normalize data.

The DEFINE syntax is:
DEFINE <recordSetName> AS ...
In the following example, the RegionTotals record set is used in a subsequent calculation:
DEFINE RegionTotals AS
SELECT SUM(Amount) AS Total
GROUP BY Region;

RETURN ProductPct AS
SELECT 100*SUM(Amount) / RegionTotals[Region].Total AS PctTotal
GROUP BY Region, Product Type