Skip to main content
New Idea

Ranking in Rules Engine

Related products:None
  • December 17, 2018
  • 22 replies
  • 429 views

cmultanen
Forum|alt.badge.img+1
It would be great if we could rank accounts in the Rules Engine, similar to ranking in Report Builder. For example, ranking accounts so that only X number receives a certain CTA or action. A specific use case would be ranking our top 50 customers by spend to automatically generate CTAs and other field triggers as part of our top 50 customer engagement program.

22 replies

sdrostgainsightcom
Forum|alt.badge.img+4
  • Gainsight Employee ⭐️⭐️⭐️
  • December 17, 2018
Great request, Calvin - I'm adding my vote.

I like the fact that this could also satisfy another much-requested rules-engine enhancment: the ability to select the "most recent" of a series based on a date.

Right now, to get the 'most recent' record, MaxDate has to be grabbed from the larger data set then joined back into that larger set to "flag" the record that's most recent.

The same "ranking" feature in Transformations would allow you to select the "Top 1" by a date for the most recent record in the same way that "Top 50" might allow all contacts with the top 50 health scores to be selected.

NOTE: I think this ranking has to be allowed within sub-groups - treated as another aggregator, essentially - so the top 5 or "x" within, say, each Customer Type could be selected.


dan_ahrens
Forum|alt.badge.img+2
  • Expert ⭐️⭐️⭐️
  • December 17, 2018
Great suggestion Calvin!

A function like TOP, LIMIT, or RANK in rules engine would be quite useful!


seth
Forum|alt.badge.img+9
  • Gainsight Employee ⭐️⭐️⭐️
  • December 17, 2018
Jumping on here with a vote to rank not just customers, but any records. I may want to find the Contacts with the most pageviews, regardless of their Accounts, for example.


sudheer_sharma_goda
Forum|alt.badge.img+2
I concur with all of you, need rank() over partition by kind of function in rules


toddmassey
Forum|alt.badge.img+5
  • Helper ⭐️
  • January 16, 2019
+1

Ranking opportunites would be another use case. If a customer has multiple contract/Oppts. I have a use case for ranking them by contract start date.


hiromi_yamamoto
  • Contributor ⭐️⭐️
  • July 24, 2019
Great suggestion! I want ranking sort in Rule Engine, too.

When I sort by count field which I created with Rule engine tasks,

We can update data from small count to large count.

It indicates we can update most large count record's data to the updated records.


jeremy_johnston
Forum|alt.badge.img
I was looking for this exactly today, thanks Scott.

Right now, to get the 'most recent' record, MaxDate has to be grabbed from the larger data set then joined back into that larger set to "flag" the record that's most recent.


jamie_anderson
Forum|alt.badge.img+1
  • Contributor ⭐️⭐️
  • September 1, 2020

+1 for me, any updates? This would be great. We would like to use ranking in rules engine for several areas: 

Contact level reporting for Top 50 accounts on a dashboard  (Being able to use a tile report with ranking would be...incredible...so, double bonus if that became possible) 

Use in Journey Orchestrator - sending emails to Top X accounts in different segments or by territory

Potentially help prioritize CTAs for some of our high volume touch teams>currently we use a score to sort for this team, but could see this functionality making a ‘sort’ logic much easier 


cnichols
Forum|alt.badge.img+1
  • Helper ⭐️
  • September 2, 2020

We have many use cases where we are looking for the Top X and these functions would be great if we could have then integrated into the the product. 

Examples that we have: Support Incidents that we are ingesting - What are the top kinds of support incidents? 


rakesh
Forum|alt.badge.img+2
  • Lets put your data to work!
  • December 3, 2020

Hi All,

This is a great idea, I can see how this is useful. I’ve added this to the roadmap and will push any updates. 


godwin_saldanha
Forum|alt.badge.img
  • Contributor ⭐️⭐️
  • April 28, 2021

Hi @rakesh , any updates on this?


hardik_mota
Forum|alt.badge.img+4
  • Helper ⭐️
  • July 29, 2021

Hi @rakesh !

One of my customer was also looking for this feature to limit the number of CTAs created by a rule (ex - 50 a day)? Or is there a data function in Gainsight rule that shows the top x rows? Do we have any ETA?

 My users are only generating a type of retention CTA for customers who are at high risk. Due to the workload limit of our team members, we need to cap the number of this CTA to around 50 a week. Therefore, we need to be able to get the top 50 risk scores. Right now, we plan to pull the data out of Gainsight, calculate the top 50 and then enter that into gainsight back manually.

ccing @saewonpark 


jason_metzler
Forum|alt.badge.img+2
  • Helper ⭐️⭐️
  • January 21, 2022

+1 for our org as well. While the method outlined here is awesome, it’s not feasible past a few records. I need top 300. No way I’m doing all those merges.


phani_kumar
Forum|alt.badge.img+3
  • Gainsight Employee ⭐️⭐️
  • May 2, 2022

Hi All.

I came across this use case recently, and I have calculated the Rank through Rules.

Here is the details. 

 

Thanks.


  • Contributor ⭐️⭐️
  • November 14, 2023

@rakesh

Any updates on this? 


keith_mattes
Forum|alt.badge.img+3
  • Helper ⭐️⭐️
  • November 15, 2023

We need to use this functioanality to prevent massive email sends to customers and our use case is: 

 

As a Gainsight Admin/Program manager, I ONLY want to send emails to the top “X” number of contacts at a customer in order to prevent potential blacklisting. 

Additionally, being able to send to contacts that have done a “thing” in the last “X” days also would be cool (and configurable by filters) but we are presently unable to limit the results, especially by Account. 

This would go a long way within JO to help prevent spam and excessive emailing to the customer and also decrease load on the system :) 


Hi Gainsight team,

Our requirement is to send quarterly NPS survey. The contacts from each company would be distributed in four equal groups. First Quarter, the first group of contacts will get the survey. Second quarter, the second group will get and so on. To achieve the grouping of contacts, we are currently using Excel. If Ranking() or Row number() functionality is made available in Gainsight rules engine or JO query builder, we would be able to automate the process.


spencer_engel
Forum|alt.badge.img+5
  • Expert ⭐️
  • February 5, 2025

We need this so badly! Please reference my Community post here for my use case: 

 

 

Also you can see in this screenshot what I had to do just to rank 5 dates and 5 numbers. If there was a ranking formula, I think I could cut out about 80% of these transformations and merges.

 

 


alizee
Forum|alt.badge.img+13
  • VIP ⭐️⭐️⭐️⭐️⭐️
  • May 19, 2025

@rakesh Any updates in this becoming a function instead of an obscene amount of transforms and merges? 


saltamash
Forum|alt.badge.img+8
  • Helper ⭐️⭐️
  • June 4, 2025

Wild that this 6-year-old post having 50+ upvotes, still has the status as “New Idea” and not “Acknowledged” 

@revathimenon Can we please get some eyes on this request? The fact that for get such a simple thing we have to create 10 steps as highlighted in Calculating Rank using existed field value in Rules post is mind boggling. 


katelyn.turner
Forum|alt.badge.img+4
  • Contributor ⭐️⭐️
  • October 21, 2025

Adding my voice to this request as I am coming across the need to segment customers by being top x number of a CSMs book of business. This is not an uncommon request in our industry and shouldn’t be as difficult as it is with current functionality.


dayn.johnson
Forum|alt.badge.img+7
  • VIP ⭐️⭐️⭐️⭐️⭐️
  • October 22, 2025

Chiming in here, since it seems I haven’t yet.

We had a report in one of our emails leveraging an external (Domo) ranking X by Y.

The fact that we had to resort to an external system to create that data and then bring it into a Gainsight object to use it in one of our programs doesn’t make sense. Particularly since the request had to be managed by a separate team. It’d be so much easier to be able to build that directly in a report/DD template, without having to go through multiple systems and complex dependencies.