create a card to display a number ranking

Options

can anyone point me in the right direction on how to create a card with a number ranking that will auto update? we give the sales people a score based on their activities. the one card will put them in order based off their activity score total. how do I create a separate card to just populate their Activity Score Rank? (i.e. 1st 2nd 3rd 4th 5th or 6th) the card I have now, I have to manually update. looking to automate it

Best Answer

  • ST_-Superman-_
    Answer ✓
    Options

    @ScottLeeds You need to use two aggregations for this to work.

    SUM(SUM(1)) over….


    “There is a superhero in all of us, we just need the courage to put on the cape.” -Superman

Answers

  • GrantSmith
    Options

    You can use a window function for something like this:

    SUM(SUM(1)) OVER (ORDER BY `Score` DESC)
    

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • ScottLeeds
    Options

    I hope I'm saying this correctly. The column I'm trying to use is a beast mode so it's not showing as an option. To put in the actual column name instead of the `Score` example you gave.

  • jessdoe
    jessdoe Contributor
    Options

    @ScottLeeds you can copy the score beast mode and paste it into Grant's formula.

    sum(1) over (order by (paste your beastmode here enclosed in parenthesis))

    Also, make sure you have card interactions set up on the lead card so that the rank card knows to update with the salesman clicked on in that card.

  • jessdoe
    jessdoe Contributor
    Options

    You probably want:

    sum(1) over (order by (beast mode formula)desc)

    otherwise it will rank the lowest score 1st rather than last.

  • ScottLeeds
    Options

    @jessdoe now it just populates whatever number I put in the parenthesis after sum

  • jessdoe
    jessdoe Contributor
    Options

    @ScottLeeds if you aggregate the sum again as in Grant's formula does that give you your rank back?

    sum(sum(1)) over (order by (beast mode formula)desc)

  • ScottLeeds
    Options

    @jessdoe that didn't work either

  • jessdoe
    jessdoe Contributor
    Options

    Can you paste your beastmode @ScottLeeds

  • ST_-Superman-_
    Answer ✓
    Options

    @ScottLeeds You need to use two aggregations for this to work.

    SUM(SUM(1)) over….


    “There is a superhero in all of us, we just need the courage to put on the cape.” -Superman