how to limit number of output in list view when use group by?

samani

Member
hi
i want show only 4 record in each group. is it possible with prefilter query or need other solution?
 

Attachments

  • 2018-03-14_18-07-58.jpg
    2018-03-14_18-07-58.jpg
    152.7 KB · Views: 41
How do you decide which ones you want to show?

Fabrik has filters which the user can set - but also List / Data / Pre-Filters which you can define for everyone.

So as long as you can define which records you want shown by the value(s) of a database field, Fabrik can do this for you.
 
You can set your list/navigation to Rows per page = 4 and Show Navigation to No
thank you but it is not work...
i want show 4 greatest Score for each group.for that i sort by Score and group by name...but only thing that i want now, show 4 of each...
 
OK - here is how I would do it.

I would create a hidden top4 field.

Then I would add a PHP Events List Plugin to the list, and write some php which will update all the rows and set the top4 field to 1 if it is in the top 4 and 0 if it isn't. This is probably quite complicated. You might be able to do it with a single SQL UPDATE STATEMENT or you might need to get the list of groups from an SQL statement and then iterate through the groups running an UPDATE statement for each group. The UPDATE statements are likely to have joins and / or subqueries and be quite complicated.

Then you would set up a pre-filter for top4 = 1.

But it is definitely possible.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top