Forum Academy Marketplace Showcase Pricing Features

How do I filter and sort a list by a field that is itself a list?

How do I filter and sort a list by a field that is itself a list?
I need to sort the courses from more bought to less bought. At the same time, be able to choose the time interval when purchases were made. The course database is designed in such a way that it contains a field for purchases (payments). This field is a list of payments (purchases). Sorting and filtering should be done in this field.
Using the plugin list shifter, I managed to sort by more purchased courses. But I cannot add time filtering. Need your help.

Hey @vertoletchik73

Thanks for the post!

For this, I wonder if it might make sense to go about your search in a different way. For instance, what if you got your list of courses by doing a search for orders, grouped by course. Then you could still sort the list based on number of orders, but you’d have the added ability to limit what appears in the list by limiting the date range you’re pulling orders from.

Give it a try and don’t hesitate to reach out to us directly at [email protected] with any additional questions. And, best of luck with the rest of the build.

Thanks. But how can I sort this repeating group by number of orders? I know that I can group orders by course, also I can filter orders by the day of creation and after that I can group them… The problem is l dont know how to sort courses by the number of orders in this case.



Hey @vertoletchik73

Great question! Since you’re using group by, you can actually add an aggregation where you count the number of orders that are included in the group. And, you should be able to :sort by that.

Thank you very much! It works! I tried many different methods, some of them worked, but they took up a lot of page resources when loading, I even found a solution to do calculations through the backend. Your solution is effective, simple, and elegant !!! Thank you very much for the help!

Perfect! Thanks so much for the update and nice work getting this implemented so quickly.

Don’t hesitate to reach out if we can assist with anything else. → [email protected]

This topic was automatically closed after 70 days. New replies are no longer allowed.