Forum Academy Marketplace Showcase Pricing Features

Need Help Auto-Ranking and Sorting Users

Hi there! I have built an app called agencygo.io

The app ranks digital marketing agencies by a variety of metrics and provides recommendations on how they can improve their agency.

My biggest struggle right now is trying to figure out how to rank agencies within the app.

I understand how to do this on a repeating group that is ranking based on information in the same data type.

But, let’s say, I want to rank a list of “Agency Partners” (Data Type = Users) by amount of “Deals Closed” (Data Type = Deals).

The Deal itself would have an amount, and when that closes, I want to take a list of all “Agency Partners”, get the sum of all Deals closed for each “Agency Partner” and then sort that list based on the sum of Deals closed for each “Agency Partner.”

Does this make sense? How would this be done in the app? Do I need to create a new data field called “Partner Rank” inside the Data Type User?

Then, each day would I run a backend workflow that essentially updates the ranking for each User based on the sum of Deals closed which contain this user?

Finally, would I then print the list of users in the order of their “Partner Rank”?

This is going to be a huge breakthrough for me and my app if someone can help me figure this out, as I am going to be able to unleash the full power of comparative analytics to my agency community.

Specifically, I need to do this:

  1. Find all deals with the category Payment Received.
  2. Group by PARTNER (User) and sum each grouped set of deals.
  3. Sort each group from most Payments Received to least.
  4. Make changes to each groups User. Modify their Partner Rank to their index in the sorted list in Step 3.
  5. Display list of Users in Repeating Group by Partner Rank.
  6. Repeat Steps 1-5 on a daily basis.

P.S. I will tip whoever can answer this the best $100.

Took an edible so this may not be airtight but…

I would create a new field within the User data type and call it Total Deals Closed. Each time a User closes a deal I would update this field using a workflow to add the Payment Received amount. Then when I pull up the repeating group of Users I would set it to sort Ascending by the Total Deals Closed field. This way, the rank will always be correct rather than only being updated daily.

If you already have Users then you’ll need to update their records. You’re B2B so I’m guessing you have <100 Users so you can rely on a manual solution. I would create a new page that has a dropdown to select a User. I would create a button and set the workflow to update the Total Deals Closed field for this User by doing a sum of Deals filtered by the selected Agency Partner/User field. Then I’d make the page Live and manually update each User. That should bring your data up to date.

Hope this helps :pray:t5:

Did this work @ai1 ?