SQL LIMIT and URL filtering

SQL LIMIT and URL filtering

Hi Zoho team, I'd like some advice in order to do the following.

We have a report which contains all data for different companies. We display the report using its URL and we filter it using ZOHO_CRITERIA to display one company at a time.

Now we would like to display only the top 5 rows for this report. I've read the post "https://help.zoho.com/portal/en/community/topic/top-5-expenses-for-each-month" but when I try to do the same it displays the top 5 rows for all the companies, not on a per company basis.

So, is there a way to mix both SQL LIMIT and URL filtering so that the report would display the top 5 rows for the filtered company ? Thanks !