1,660 questions
-1
votes
0
answers
19
views
DAX Ranking Issue [closed]
I have to create a measure to rank each product within it's category based on total sales. I have used RANK function for this. The first measure (pic 1) correctly achieves that. However, the second ...
0
votes
1
answer
64
views
OpenSearch get top n results by keyword field (OpenSearch 3.1)
I have a few OpenSearch indicies (running OpenSearch 3.1 on AWS) and each index has a type_slug field that tells the application what kind of object it is. I would like to get the top 5 results for ...
4
votes
4
answers
142
views
Assign top 2 ranking by group
I am trying to assign a ranking across a group, and apply the ranking across the whole group
My data look like this:
colour <- rep(c("blue", "red"), 3)
day <- rep(c("mon&...
2
votes
2
answers
68
views
Apply a conditional rank to a temporary table
Here's an idea of what the temporary table contains:
ID
FullRank
Special
1
1
No
1
2
Yes
1
3
No
2
1
Yes
2
2
No
3
1
No
3
2
Yes
3
3
Yes
3
4
No
3
5
No
And this is what I'm trying to achieve...
ID
FullRank
...
7
votes
3
answers
317
views
Rank values without skipping a rank for values after duplicates [duplicate]
The returned vector must be the same length as the original; must not skip ranks; must give same rank for duplicate values.
Input:
x <- c(1, 5, 10, 10, 50)
Desired Output:
[1] 1 2 3 3 4
Below is ...
1
vote
2
answers
57
views
PowerBI: Filter for lowest column value in table visual
I have a table with multiple columns. Few include: Customer ID, submission date etc. I have created a DAX column measure to rank by customer id by submission date. Eg If customer A has submitted 3 ...
0
votes
2
answers
71
views
Using group_by, mutate and rank [closed]
I have a dataframe of different species suitabilities and timesteps:
df <- data.frame(timestep=rep(c(1:4),10),
species=rep(letters[1:4],10),
suit=runif(40,0,100))
...
0
votes
1
answer
102
views
How to use Rank Function With Condition in Postgres
For the following sample table I want to set ranks to each group order by start_date desc but I want the admin to be always set to rank 0
name
start_Date
group_no
Admin
2023-01-01
0
A
2021-01-01
0
B
...
3
votes
3
answers
79
views
Update a table with a rank number with a subquery
I am using the following SQL query to update a temp table to be able to determine priority.
This is my SQL statement
UPDATE #CARD
SET rank_no = x.no_rank
FROM
(SELECT
rank_no, ...
0
votes
1
answer
26
views
Sorting top 4 ranking by name
I am creating an automated scouting report for a basketball team. I am looking to automatically populate a list of team leaders in a variety of categories. In this case, I am looking at leading point ...
0
votes
0
answers
55
views
Running Sum Measure Using Virtual Tables and Rankx in DAX
I'm trying to create a running sum measure in DAX that changes dynamically based on the applied filters. The running sum should accumulate values according to the rank of each row. I've already ...
0
votes
1
answer
60
views
How can I separate RowNumber counting?
I'm trying to create a point in time hierarchy in my organization. The problem I'm running into are some folks have reported to the same manager more than once in their career. I tried doing a ...
0
votes
0
answers
29
views
Ranking objects in a vector [duplicate]
Given the following vector:
a <- c(1, 6, 6, 6, 11)
How do I output a corresponding vector of value ranks like the one below
1 2 2 2 5
If I use rank() function it produces 1 3 3 3 5
0
votes
2
answers
44
views
I'm struggling to rank rows by Col1 and then if there are ties by Col2 and if there are still ties to return the same rank [duplicate]
I have a dataset showing performance of staff members against a goal. I want to add a rank column to the dataset showing who is performing the best.
The logic I want to use is to
first sort by ...
2
votes
3
answers
224
views
Excel - Ranking consecutively with duplicate values
Please see image below the "Numbers" column are the values I want to rank.
The "Preferred Ranking" is what I want as the results except I am having real trouble trying to get ...