---
schema_version: "1"
id: 783035951fa2b1864316ffba1f31878e7b4c241aeb7081323943b322f3519d77
title: Statements
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/analytics/bi_dev_guide_saql/guides/reference/bi-saql-statements.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statements.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: e7d3e5f1a2e78d146b4600bebcf5078d318d8831317099cdcc360677eeeee517
products:
  - Analytics SAQL Developer Guide
  - analytics
---

# Statements

A SAQL query loads input data, operates on it, and outputs the result data. A query is made up of statements. Each SAQL statement has an input stream, an operation, and an output stream.

A statement is made up of keywords (such as `filter`, `group`, and `order`), identifiers, literals, and special characters. Statements can span multiple lines and must end with a semicolon.

Assign each query line to an identifier called a stream. The only exception is the last line in a query, which doesn't have to be assigned explicitly.

The output stream is on the left side of the `=` operator and the input stream is on the right side of the `=` operator.

## Example

Each line in this SAQL query is a SAQL statement.

```nolang
q = load "Dataset1";
q = group q by all;
q = foreach q generate sum('Amount') as 'sum_Amount';
```

**See Also**

- [filter](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-filter.md)
- [foreach](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-foreach.md)
- [limit](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-limit.md)
- [offset](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-offset.md)
- [order](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-order.md)
