• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Ranking field

MILORD65

Member
I made a database for a riding competition with Fabrik 3.1. A calculated field gives the percentage of points obtained on the maximum possible points. The ranking is for example the following:
1: 71.00%
2nd: 70.65%
3rd: 70.00%
etc.
By a descending sort on the percentage field so I get the ranking.
I would like to more than the calculated percentage field, there is a field (calculated?), Which automatically gives the standings: 1st, 2nd, 3rd, etc.
How can I do?
Thank you for your help.

Jean-Pierre.
 
I did this by first creating a mySQL View to get the needed data. Then just make a read-only Fabrik list on the View.

If the rankings don't update often, you could probably run a Form PHP Plugin or Scheduled Task to update the appropriate field.
 
Thank you for your quick response;
That's what I've done by creating a mysql view for each event (club1, club2, club3):

CREATE VIEW v_Club2 (id, Resultat, Rang)
AS
SELECT t1.id, t1.Resultat,COUNT(*) as rang
FROM t_club2 AS t1
INNER JOIN t_club2 AS t2
ON t2.Resultat >= t1.Resultat
GROUP BY t1.id, t1.Resultat
ORDER BY rang;

However I have wanted to do the same with a php code in an element but I don't have the knowledge for this and I don't know if it's possible.
 
The reason not to try to do this with PHP in an element is that the code is only run when the form is created/edited. You can set a calc element to run on the fly in a list but that is just for display purposes - you can't actually sort or filter the list on that information.

If the View is providing you the desired information, then you can just create a new Fabrik list (read-only) pointed at it.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top