You can setup rule functions in the Rules setup of the Gateway Setup Editor (GSE).
The Gateway Setup Editor Reference Manual has documentation on the use of the different functions available. Please refer to:
Go to GSE --> Rules. Navigate to the Block field, right-click and hover over Functions, this will list the options available as shown below:
To count the number of rows, the syntax is shown below:
Where "lines up" is a path alias defined in the Rule -> Advanced Tab.