Order and Limit

Is Limit applied after Order? I want to be able to show top n customers, or products on orders, etc.

Hi @tmageebtr, welcome to the Cube.js Discourse forum :wave:

Cube.js follows the same rules as the underlying SQL database here. Usually, most databases will apply any LIMIT clauses after the ORDER BY, so you should be able to achieve top N customers etc. as easily as you would with with SQL.

Hope that helps

1 Like