SAQL is compositional—every statement has an input dataset, an operation, and a result dataset, and you can chain statements together to operate on data sequentially. The order of SAQL statements is enforced according to how the operations in the statements change the results.
The statement order rules are:
- The order of filter and order can be swapped because it doesn’t change the results.
- offset must follow filter and order
- offset must come before limit
- There can be no more than 1 offset statement after a foreach statement.