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
1
vote
1 answer
How to remove duplicate records in SQL table based on certain conditions and multi-criteria?
The following table consists of the columns EmployeeID, JobNum, CompDate.
Basically there are 3 different employees that have certain job ids and their completed date time associated with them. There are some jobNum that have no association to a…

gisewok
- 11
- 2
1
vote
0 answers
Creating statistically correct ranking based on multiple variables
I got a table with documents names with main columns being:
Document Title,
Creation Date,
Number of Downloads
Ranking (stars: from 0 to 5),
Number of times the documents was ranked
The only fields that are always filled in with data…

kuatroka
- 562
- 7
- 18
1
vote
0 answers
MQL5: How to Rank an Array's values
I used R and the rank function to create the following ranks for the original var x:
x average first last random max min
3 4.5 4 5 5 5 4
1 1.5 1 2 2 2 1
4 6.0 6 6 6 6 6
1 1.5 2 1…

trader
- 13
- 2
1
vote
1 answer
A more elegant way to apply Nested Ranking over SUM of a few columns
Is there a more elegant way to apply nested ranking over a few different columns, sorted by the total of the leftmost column, then by the total within that the group? I am providing the screenshot re: sample data structure and the desired…

The Lyrist
- 434
- 3
- 13
1
vote
2 answers
How to choose matchups in an ELO ratings system as matchups accumulate
I'm working on a crowdsourced app that will pit about 64 fictional strongmen/strongwomen from different franchises against one another and try and determine who the strongest is. (Think "Batman vs. Spiderman" writ large). Users will choose the…

Chris Wilson
- 6,599
- 8
- 35
- 71
1
vote
1 answer
SQL for conditional value ranking
I'm trying to add a column to this table:
CREATE TABLE #NEW_HIGH (SYMBOL char(4) not null, CLOSE_DATE date not null, CLOSE_PRICE money)
INSERT INTO #NEW_HIGH VALUES ('A','01/07/2019',31.46)
INSERT INTO #NEW_HIGH VALUES ('A','01/08/2019',32.5)
INSERT…

user1315414
- 21
- 1
- 2
1
vote
2 answers
Custom plugin for Elasticsearch to change the default relevancy
I am currently using Elasticsearch and there are few things I have noticed about the ranks of the search results, which led me to think about whether there is a way to create plugins/script for ES, which can be used to modify the current scoring…

Pratiksha Sharma
- 79
- 12
1
vote
1 answer
Cosine similarity between query and document in a search engine
I am going through the Manning book for Information retrieval. Currently I am at the part about cosine similarity. One thing is not clear for me.
Lets say I have the tf-idf vectors for the query and a document. I want to compute the cosine…

Kolev Kriso
- 11
- 1
- 3
1
vote
1 answer
display null value using rank functions in oracle sql
This is an extension of another question: How to display null value when the record is present more than one time in oracle sql
I have a table set like following:
c_id c_name c_tax
1001 Element1 1
1001 Element1 2
1001 Element2 …

Santosh
- 2,355
- 10
- 41
- 64
1
vote
1 answer
What metrics can I use to validate and test RankNet in the RankLib library in the Lemur Project?
I am currently using the RankLib implementation of the RankNet algorithm (-ranker 4) with a held-out set. I am using the jar file in terminal to run this.
The documentation stipulates:
metric2t (e.g. NDCG, ERR, etc) only applies to list-wise…

BenObe
- 13
- 3
1
vote
1 answer
Can we merge rankings from somewhat-similar data sets to produce a global rank?
Another way of asking this is: can we use relative rankings from separate data sets to produce a global rank?
Say I have a variety of data sets with their own rankings based upon the criteria of cuteness for baby animals: 1) Kittens, 2) Puppies, 3)…

truckbot
- 83
- 1
- 8
1
vote
1 answer
how to rank the items in chronological order in excel
This is the list of score of 4 people.
jack 23
bob 25
lorty 45
sam 25
If i use rank.eq function then it gives rank lorty-1, bob-2, sam-2 and jack-4
is there any way the ranking can be made lorty-1, bob-2, sam-2 and jack-3

Riykace Maharjan
- 11
- 1
1
vote
1 answer
R: Split - Apply - Combine to get cummulative variable
This is a small rep of the df:
Name <- rep(c("Kobe Bryant", "Julius Randle", "Robert Sacre" ,"Lebron James", "Kevin Love"),c(2,2,2,4,5))
Team <- rep(c("Los Angeles Lakers", "Cleveland Cavaliers"),c(6,9))
Date <- as.Date(c("2015-05-14",…

Sburg13
- 121
- 5
1
vote
1 answer
Get the first occurence of the result in each specified group
I have this query in sql server 2012
select sum(user_number),
sum(media_number),
month_name from (
select TOP 100
count(distinct a.answer_group_guid) as 'user_number',
count(distinct a.media_guid) as 'media_number',
…
user4045747
1
vote
1 answer
MYSQL order by field condition in case of tie
I have a mysql table like this
Brand Count
TOYOTA 20
HONDA 50
BMW 5
PORSCHE 10
HYUNDAI 10
MAZDA 10
I want to sort the table based on the COUNT column in Descending and in-case of tie I want to order the BRAND column…

user3913971
- 13
- 1
- 4