This query shows how the IN
filter can be used to populate a pie chart showing sales divided into six segments: one segment for each of the five largest customers, and one segment showing the aggregate sales for all other customers.
RETURN Top5 AS SELECT SUM(Sale) AS Sales FROM SaleState GROUP BY Customer ORDER BY Sales DESC PAGE(0,5); RETURN Others AS SELECT SUM(Sale) AS Sales FROM SaleState WHERE NOT [Customer] IN Top5 GROUP