The AS clause allows you to give an alias name to EQL attributes and results.
The alias name can be given to an attribute, attribute list, expression result, or query result set. The aliased name is temporary, as it does not persist across different EQL queries.
Alias names must be NCName-compliant (for example, they cannot contain spaces). The NCName format is defined in the W3C document Namespaces in XML 1.0 (Second Edition), located at this URL: http://www.w3.org/TR/REC-xml-names/.
DEFINE EmployeeTotals AS SELECT DimEmployee_FullName AS Name, SUM(FactSales_SalesAmount) AS Total FROM SaleState GROUP BY DimEmployee_EmployeeKey, ProductSubcategoryName;
In the example, EmployeeTotals is an alias for the results produced by the SELECT and GROUP BY statements, while Name is an alias for the DimEmployee_FullName attribute, and Total is an alias for the results of the SUM expression.
EQL statements typically use expressions to compute one or more derived attributes. Each aggregation operation can declare an arbitrary set of named expressions, sometimes referred to as derived attributes, using SELECT AS syntax. These expressions represent aggregate analytic functions that are computed for each aggregated record in the statement result.
RETURN price AS SELECT AVG(Price) AS "Average Price"The space would have to be removed:
RETURN price AS SELECT AVG(Price) AS AveragePrice