I’ve made a CRM for a local medical practice to track how many doctors (ie “Contacts”) have referred patients to them over time so they can nurture those relationships.
Part of the app is a list of “referral trends” so they can see who has historically referred the most patients to them over the long-term and compare that to more recent averages. The goal is to be able to quickly see who may be “underperforming” and may need a check-in to nurture the relationship.
This is a repeating group that displays a list of Contacts – the RG data source is a Search for Referrals that each Contact has made and is grouped by Contact. Each row has three columns: one for the total number of referrals over the past 12 months, one for a rolling 3-month average number of referrals during the past 12 months, and one for a list of referrals made in the past 90 days. If past 90 day referrals are less than their 3-month average, it shows a warning; if past 90 day referrals are greater than their 3-month average, it shows a green check mark:
Here’s my question: is there a way to sort the RG by the third column so that it shows the largest percentage difference between the average and the past 90-day referrals? I’m mostly interested in seeing the largest difference between 3-month average and past 90-day referrals, not necessarily the largest number of past 90-day referrals. I’ve been having trouble sorting this way since the third column is calculated in real-time, not a property on an individual Contact record.
@keith would List Shifter still work if the Referral data type references a Contact, but the Contact data type doesn’t have a list of Referrals?
Right now, the RG is a search for Referrals grouped by the Contact who made each Referral. If I query a list of Contacts, I can’t see a list of the Referrals each Contact has made…so would List Shifter still work in this scenario?
Any list you can construct or express can be used as the list to sort by. It’s literally like this:
I have some list expression List_1 of anything:
Gamma
Alpha
Delta
Beta
I have a corresponding list expression List_2 (of string, number or date type) that represents the values by which I want to sort List_1:
10
1
5
100
This List_2 is what goes in “Sort Source List” (or whatever it’s called in the SORT action interface). Internally, List Shifter creates objects that associate the corresponding values. So:
{Gamma, 10}
{Alpha, 1}
{Delta, 5}
{Beta, 100}
Then sorts them (let’s assume numerically in this case):
{Alpha, 1}
{Delta, 5}
{Gamma, 10}
{Beta, 100}
And spits a new list of the List_1 values, sorted in the desired order, out at the Sort output: