Row_number (or something analogous)

Hi all, I am looking for an expression which numbers the output of a result set, identical to the SQL-function below:

Is this already available in Novulo? If not, is this something that could be designed?

Hey Axel,

We do not have a function (that i know of) that does this.
You could however add a sum to your expression that counts all records in your query above the current one.

In this example we’re getting a set of user records.

Expression
{
users,
<int:sum({users,1,boolean:and([id.islower(parent.id)]),id.asc}).add(1),
id,
email>,
true,
id.asc
}

Result

Important here is that both sort expressions are the same.
If you want the row number to start at 0 you can remove the “add(1)”.

Does this help you?

2 Likes