Questions tagged [ranking-functions]

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.

193 questions
0
votes
1 answer

Solr feature that is based on the distribution of a document value

I am trying to do reranking Queries today. My features.json looks like this: [ { "name" : "documentRecency", "class" : "org.apache.solr.ltr.feature.SolrFeature", "params" : { "q" : "{!func}recip(…
0
votes
3 answers

We need to provide rank. Logic is whenever we have a value 'Product' then we must start the new number & all other below should follow the same rank

Sample Input: ID Vals 1 Product 2 Milk 3 Butter 4 Cheese 5 Yogurt 6 Product 7 Muesli 8 Porridge 9 Product 10 Banana Sample…
0
votes
3 answers

How could I write a function to find fractional ranking of a list of numbers?

I'm trying to write a code in Python to create a fractional ranking list for a given one. The fraction ranking is basically the following: We have a list of numbers x = [4,4,10,4,10,2,4,1,1,2] First, we need to sort the list in ascending order. I…
0
votes
1 answer

Fuzzy search with Python Whoosh (Rank/Score Direct Hits higher than Fuzzy Hits)

I am having trouble with Fuzzy Queries giving higher relevance to Fuzzy Hit terms than Direct Match on Python Whoosh. Is there any existing options available within the library to score direct matches higher? or I have to separately code it (i.e.do…
0
votes
1 answer

Rank by DATETIME in BigQuery

I have the following table schema: Field name Type Mode Policy tags Description order_id STRING NULLABLE customer_id INTEGER NULLABLE order_datetime TIMESTAMP NULLABLE …
bran
  • 85
  • 2
  • 8
0
votes
1 answer

Order by descending aggregation within window function in PostgreSQL

I have a dataset that features duplicate values of the the primary variable, something like the following: col1 col2 counts 110 False 1 111 False 2 111 False 1 112 True 3 112 False 2 112 False 1 113 …
0
votes
2 answers

Hive SQL Ranking With Ties

How to Re-Write below Query in Hive SQL I have tried the below in Oracle SQL and it works but need to write the same in Hive QL select * from sales order by unit_price fetch with ties
0
votes
1 answer

Qlikview Pivot Table Top X by week

I have a pivot table with week number (columns) versus product (rows). I want to see the top 10 products, based on sales, per week, a value of 1 would indicate the product is in the top 10. I'm using the expression below and I'm getting the Top 10…
NancyG
  • 17
  • 2
0
votes
1 answer

Copy the Excel RANK formula without changing the end reference

Suppose I have a simple spreadsheet with 3 rows of data that I want to rank in separate columns. The example I will use is simple, but my actual dataset is 12k + rows. In this simple example, I want to use the RANK formula from Excel to do this. To…
gwydion93
  • 1,681
  • 3
  • 28
  • 59
0
votes
1 answer

I a have a large list of suppliers and a larger list supplier email addresses

I a have a large list of suppliers and a larger list sender email addresses. Sometimes a supplier will have the same sender email address called 'processor x'as the sole sender emailing, another supplier might have many sender email addresses but…
Ian Currie
  • 111
  • 1
  • 6
0
votes
1 answer

Rank() Over Partition By to rank over a table column to give me the older records

THis is what i have - a query that retrieves all the Persons that have a duplicated email address believe rank over partition by should solve my problem (The filter is the Email Address) SELECT a.Id, a.EmailAddress,a.UntilDate,a.CreatedOn,a.UserId …
JoãoEs
  • 9
  • 7
0
votes
0 answers

How to perform OLAP queries using several tables to perform TOP N sales?

Good Afternoon, I am new to OLAP (and dabatases in general). I need to write a query to retrieve the TOP 10 sales for a year by product. To do so I would have to work with three tables (simplified just to show the main…
Sergi
  • 471
  • 3
  • 13
0
votes
1 answer

In Google Sheets, why does rank() treat two identical values differently?

I have a sheet with four values that I believe are all equal (i.e. =A1=B1 returns TRUE for each pair). However, when I use rank() on a list with those values, they receive different ranks. To my knowledge, I'm not doing anything strange, such as a…
0
votes
0 answers

Can we use mysql RANK function in join table?

I'm trying to get rank using this query. The join table works well with proper list. I want to add a column for rank. Is this possible using RANK() function or I've to use variables. SELECT ID, user_login, user_email, …
0
votes
2 answers

Find the cycle time of a ticket number for different intervals

TicketNo ActionDate OldStatus NewStatus CycleTime/Sec 1001 2014-02-14 10:17:05.000 Assigned InProgress - 1001 2014-03-05 02:03:44.000 InProgress Reply 1611999 1001 …