Ranking functions return a ranking value for each row in a partition. Depending on the function that is used, some rows might receive the same value as other rows. Ranking functions are non-deterministic.
Questions tagged [ranking-functions]
193 questions
0
votes
0 answers
Rank Week over Week in Sql
I would like to be able to show our partner (customer_organizations) rank by order count and then also by gross revenue week over week (month over month) etc. I want the output to show something like this. I'm currently writing this in Zoho…
0
votes
1 answer
How to rewrite pandas.rolling().rank(method='average')
I have to rewrite Pandas to Spark. I have problem with this part of code:
#struct_ts is Spark DataFrame
#columns_to_take_pctile =
-
#period = 65 (days) / 130 / 260 / ....
grp = struct_ts.groupby(["struct",…
0
votes
1 answer
auto ranking of rows when new data is added to sheet
I have a Google sheet (sheet A) that gets fed from another sheet (sheet B). I am trying to auto-rank the rows when new data gets added to sheet B.
In the provided example screenshot (Example below), I use a formula for the "Points" column (M). All…

Simba1309
- 11
- 4
0
votes
1 answer
ROUND not working when row_number() function is present
This is a simplified version of what I'm trying to do.
I am trying to rank users based on how many miles they walked overall.
This data is stored in the table called walks. Every time a user makes a walk, an entry is added.
create temporary table…

sergei
- 803
- 7
- 12
0
votes
0 answers
Rank Loss for News feed / Recommendation problem
How do I use the rank loss (or triplet loss) for a feed ranking or recommendation problem? In other words, how do we create the training data for rank loss (or triplet loss) model training? Thanks!

Edamame
- 23,718
- 73
- 186
- 320
0
votes
1 answer
python Ranking on rows having same value is giving random ranking not as ascending = False
Here is df, I want to Rank on value on group "Id" , ranking within class
df['Rank']=df.groupby(["Id"])[' value'].rank(ascending=0)
Sample df
Expected Result
Expected Result
Result what I get from above code
Result what I get from above code
Above…

user20663141
- 1
- 1
0
votes
0 answers
How to not count duplicate null-values in rank() function in PostgreSQL?
I'm relatively new to PostgreSQL and I'm working with window functions.
I have 2 relations: company and employee. Employee contains an information about the salary. I just wanna to get a rating of employees by their salary in ascending order.
This…
0
votes
1 answer
Ranking with multiple ocurrence of ties in Pandas
I need to rank my df by some columns. Have a look at the print below
The lines need to be ranked from 1 to 20 by the column df['pontos_na_rodada']
If we issue some ties - which will occur - they have to be resolved by the highest value in column…

Vinícius Felizatti
- 61
- 10
0
votes
3 answers
How to rank SQL Server table entries by field criteria using primary key
I have an Access database that uses a SQL Server back end, and I have written a query that ranks entries in the Panels table by AgreementID column, using the PanelID primary key to determine ranking.
The query in MS Access is this:
SELECT
…

Chris
- 35
- 10
0
votes
0 answers
SQL rank function to show lowest number members in a policy not working
I have two tables. One with a policy name and one with member details. I need to identify the policy name with least amount of members and want to use a rank function but it isnt working for me. Getting strange result. Sample of the results can be…

jamster126
- 37
- 1
- 5
0
votes
2 answers
Ranking the multiple categories in the search result
I have a problem with rating different categories when displaying search results, I hope you can help me.
Let's say I searched "shoes" and this terms is exist in different cat:
Shoes in men's shoes
Shoes in women's shoes
Shoes in children's…

Sanaz
- 1
- 1
0
votes
0 answers
Rank + Countif formula not working correctly
I have used this formula on excel for many years but its run into a problem
=RANK(B2,$B$2:$B$2461,0)+COUNTIF(B$2:B2,B2)-1
For some reason its not returning ranks 491, 492 and 519

Andy Stillwell
- 13
- 4
0
votes
2 answers
Google Sheets : Group By one column and Rank by 2 columns
I have a table like below where I need to group by column A and determine rank/priority based on the logic below:
These are the steps I would like to do :
First Group by column A
Then check column B for each group. The lower the start date, the…
0
votes
0 answers
How to track branching records on a table
Example, there are machines that processes and produced materials, is there a way to track the output of machine becoming the input of another, and counting how many passes the process took? here is the example desired output (pass…

Lazz
- 1
- 2
0
votes
0 answers
Can't find a package for RankBoost
I want to do ranking in R and I want to use the RankBoost algorithm. However, there seems to be no packages for R or even for python. The closes package is RankAggreg but that doesn't use the RankBoost algorithm. How can there not be an already…