Newer Version Available

This content describes an older version of this product. View Latest

offset

Use offset to page through the results of your query.

Syntax

1result = offset rows number;

Usage

Skips over the specified number of rows when returning the results of a query. You typically use offset to paginate the query results.

When using offset in your SAQL statements, be aware of these rules:
  • The order of filter and order can be swapped because it doesn't change the results
  • offset must be after order
  • offset must be before limit
  • There can be no more than one offset statement after a foreach statement

Example - Return Rows 51–101

This example loads the opportunity dataset, sorts the rows in alphabetical order by account owner, and returns rows 51–101:
1q = load "DTC_Opportunity";
2q = order q by 'Account_Owner';
3q = foreach q generate 'Account_Owner' as 'Account_Owner', 'Account_Type' as 'Account_Type', 'Amount' as 'Amount';
4q = offset q 50;
5q = limit q 50;