Retrieves a number of rows from a table efficiently, skipping a number of rows. Compared to TOPN, the TOPNSKIP function is less flexible, but much faster.
Number of rows to return
Number of rows to skip
Table expression made by physical columns of the data model that are not grouping the cardinality of the original table they belong to.
Expression used to define the sort order of the result
It can be ASC or 1 or TRUE to consider the OrderByExpression in an ascending order.
The table returned is not sorted, it is just filtered according to the required parameters.
The sort order of the result depends on the ORDER BY condition of EVALUATE.
If Skip is not 0, the Table expression must reference physical columns with lineage and does not support a filter context coming from context transition.
If there is a tie, in OrderBy_Expression values, at the N-th row of the table, then all tied rows are returned. Then, when there are ties at the N-th row the function might return more than n rows.
If N_Value is 0 (zero) then TOPN returns an empty table.
TOPNSKIP does not guarantee any sort order for the results.
Learn more about TOPNSKIP in the following articles:
Contributors: Alberto Ferrari, Marco Russo