Questions tagged [rank]
Rank refers to the relative position, value, worth, complexity, power, level etc. of an object.
1,648
questions
0
votes
0
answers
24
views
Extending length of Pairwise comparison in python
I'm trying to determine a way to extend pairwise comparison in python. For example, instead of just comparing A versus B, I want to compare A versus B versus C. Ideally, I'm trying to find a solution ...
-1
votes
0
answers
20
views
When using Server: Uncaught TypeError: mysqli_fetch_all(): Argument #1 ($result) must be of type mysqli_result, bool given [duplicate]
I'm using following code:
$userdata = mysqli_query($db, "SELECT RANK() OVER(ORDER BY ranking DESC) AS rank_place, user, userid, round, ranpoints, ranking FROM tournament WHERE tourid='$tourid' ...
0
votes
0
answers
31
views
Excel pivot table : rank groups by same sub category
In a pivot table I have groups, each group has 5 same sub categories in percentages of the total of each group : cat1, cat2, cat3, cat4 and cat5, as follows :
GroupA = 100%
cat 1 = 23%
cat 2 = 12%
...
1
vote
2
answers
56
views
Ranking by groups of continuous equal values
With this query:
with tbl as
(
select 1 ord, 'A' name from dual
union all
select 2 ord, 'A' name from dual
union all
select 3 ord, 'A' name from dual
union all
select 4 ord, 'B' name ...
0
votes
2
answers
46
views
Libreoffice Calc: How to rank numbers without skipping ranks? [closed]
I have a table with Points/Game in one column and I want to rank the teams by relative place in the second column, but the RANK function does not do what I was hoping and adds all tied places to the ...
0
votes
1
answer
21
views
RANX returning 1's only when grouping applied
In Power Pivot, this DAX formula ranks all values in the Sales column:
=RANKX(ALL(Table2),[Sales])
The resulting table:
Group | Sales | Calculated Column
A | 2 | 4
A | 3 | 3
B | 4 ...
0
votes
1
answer
64
views
Writing group ranking without for-loops in Python + NumPy
My goal is two create a function that takes in two input arrays and outputs ranks withing groups. More specifically, the first input to the function is an array of scores (scores, and the second input ...
1
vote
1
answer
44
views
Converting a sparse R integer dgCMatrix to a corresponding sparse R rank dgCMatrix
This another question about efficient handling of a large R sparse Matrix (dgCMatrix):
I would like to convert my existing ~15,000 x ~90,000 dgCMatrix to a corresponding rank dgCMatrix, where rank ...
0
votes
0
answers
24
views
How to create an average, rank, total measures over a field (by dynamic period) in SSAS
I'm new with SSAS technology and I have an existing cube that measures hits by page on web site.
In few words the cube is structured as followed:
a dimension 'Expression' that contains reference to ...
0
votes
0
answers
14
views
Finding uniform set of Rows returned by rank in Postgresql
I have a table in Postgresql
for which I performed analytical function and grouped as lastest records based on column_3
table 1:
now as per the resulset org:2 have latest date(29-07-2023) so I ...
-1
votes
1
answer
43
views
rank error in php displaying one rank only
$avr = intval($result->markk / 11);
$numbers = array($avr);
rsort($numbers);
$arr = $arr1 = array();
$i = $rank = 1;
foreach ($numbers as $key => $value) {
$arr[$value][] = $value;
}
...
0
votes
0
answers
34
views
rank function for mysqli 5.7 version [duplicate]
I was using the Rank() function on mysql and it was not working. I want exactly the rank function type of codes which skips one rank after double rank occurs and I didn't get any.
This is the query:
...
1
vote
1
answer
62
views
Ranking a list of terms by the values in several columns
I manage a film festival that holds an annual 'best film' competition. There can be up to 50 films and any number of judges each year.
I plan to use R to analyse the various judges' scores then ...
0
votes
0
answers
25
views
assessing stochastic dominance?
According to wikipedia and other scattered software documentation Kruskal Wallis tests assess "stochastic dominance". But which type of stochastic dominance from those discussed here? The ...
0
votes
1
answer
33
views
In Excel, how can I PercentRank only values above a certain threshold in one column?
In Microsoft Excel, I'm looking to percentrank values in one column, but I'd only like to rank those that are that are above 1,000. All the others that are below 1,000, I'd like to leave a zero. Here'...
0
votes
1
answer
103
views
Power BI DAX RankX only returns 1
I am new in Dax and I am studying the Rankx function.
I have a simple table with Id, price, product, category.
When I use the function in the folowing way I only get rank 1 for all products and I am ...
2
votes
2
answers
70
views
Creating RANK in Excel with conditions in Excel
I have a file I need to have ranked but need to ignore specified rows.
Here is an example.
A B C
INCLUDE ORDER RANK ORDER
1 1 1
0 2 ...
0
votes
1
answer
25
views
RANKX excluding users registered less then 3 months ago
I want to calculate the users rating using this formula :
«users rating» = «sales rank» * 0.75 + «bonus rank» * 0.25
«sales rank» and «bonus rank» — ranging sales growth in % (last month to a month ...
0
votes
0
answers
25
views
POWERBI DAX_Combining Filter, Rank and Sumx
Below, I have the following table in which I need to evaluate incidents for individual segments. It is always in the format CW. 1-191, I evaluate incidents; CW. 1-192, I evaluate incidents; CW. 1-193, ...
-1
votes
1
answer
45
views
Determining absolute ranking with limited relative ranking data
I'm trying to analyze data to determine which markets are the largest (there are ~40 markets total). Unfortunately the only data we were able to collect is asking survey respondents to rank up 6 ...
0
votes
1
answer
45
views
How to get 2 and 3rd rank student from total Marks (Sum of Marks)
I have Students table with columns SID, NAME, and a Marks table with columns SID, SUBJECT, MARKS.
How can I get 2nd and 3rd ranked students based on total marks?
I tried this SQL statement, but I get ...
1
vote
3
answers
63
views
Add a new column with a sortorder grouped on column but in original sort order
I've got a dataset that I want to order in a certain way, I need it to be grouped by CENTER
but other than that the records must remain the same sort order as the original dataset. So VUMC is the ...
1
vote
1
answer
13
views
Ranking only the observations over a certain value
I have the following table:
DROP TABLE IF EXISTS #df
CREATE TABLE #df
(
CommID VARCHAR(10),
ProvID VARCHAR(5),
VisitCount int,
[% Score] INT,
TimePeriod VARCHAR(10),
...
1
vote
2
answers
55
views
RankX does not work by Categories and only shows '1'
SITUATION
I have a Table with two Columns:
Category (String)
Value (Integer)
If I create a measure with RankX I get a Rank over the complete table, sorted by value. Everything is fine.
Table with ...
0
votes
1
answer
62
views
Number of days since last purchase
I have a query below that is working but I am having some issues, which I hope someone could help me with.
First, I want to do a JOIN to include the customers first and last name in the output.
Second,...
0
votes
1
answer
65
views
How to ignore the 'over partition by ' setting for Power BI Rankx
I have a table, with 3 columns: Account Name, Account Type, and Revenue (summed up from revenue of user selected months in the month slicer). I would like to rank this table according to each account'...
1
vote
2
answers
43
views
Select rank for one given user_id
I have a following table representing user activity in API endpoints.
create table crud_logs (
id bigint generated always as identity
constraint pk_crud_logs
primary ...
0
votes
1
answer
31
views
The Solution of Duplicate Rank doesn't Work on Excel
The rank 25 doesn't work as it should be. Please help.
I use below formula to do rank on Ms. Excel.
=RANK(H7,$H$7:$H$56,0)+COUNTIF($H$7:H7,H7)-1
And below is the data on my table. The total is 32 rows....
0
votes
1
answer
79
views
Reset ranking in snowflake ordered by date and id for identifying repeat calls sequence
Need help in snowflake.
I need to identify which is the first and last repeat call within 7 days by a customer partitioned by customer_id and ordered by call_time.
enter image description here
"...
0
votes
1
answer
69
views
How can I change my Rankx formula to a formula where tied ranks are getting skipped?
I am getting frustrated with a rankx formula in my Power BI Dashboard. I hope someone can hep me with it.
Situation:
I have a table "Events". This contains the results (column "Points&...
1
vote
3
answers
90
views
How to ignore ranking if the data conatins NaN or Inf in R?
I have a dataframe that contains NaN and Inf. I want to rank the data based on a variable (Q). So, I am using
rank(df$Q, ties.method= "first")
#> [1] 3 5 6 4 2 9 7 10 8 1
As ...
0
votes
1
answer
22
views
Get a result based on previous row in Python
I am struggling with the following. I am analysing of what happened after first attempt. Rank > 1
I managed to prepare the data, by ranking (Rank) based on Date. In the example below, I`m trying ...
0
votes
0
answers
40
views
Rank and Select operations in BST without size attribute
I want to compare the order statistics of three different data structures: sorted list, red-black tree, and binary search tree. I have successfully implemented the rank and select operations for the ...
0
votes
2
answers
151
views
Scrape the university name (in QS World University Rankings website) with R
I want to scrape 2021 University Ranking data from the QS World University Rankings website (https://www.topuniversities.com/university-rankings/world-university-rankings/2021) with R.
I found the ...
1
vote
1
answer
36
views
Reattribution of values based on a reversed rank
I have been stuck on a very simple task, reattributing values of a column to another column based on a reversed rank.
Here is my trial with a reproducible example :
df <- data.frame(sum_values = c(...
0
votes
1
answer
52
views
how can I order this by rate using only mutate() and filter() function
> murders <- mutate(murders, rate = total/population*100000, rank = rank(-rate))
> filter(murders, rank <= 5)
state abb region population total rate rank
1 ...
3
votes
0
answers
91
views
SQL: Ranking Using Ntile vs Percent_Rank
I am working with (Netezza) SQL through R.
Suppose I have the following data for the height of students. I purposefully simulated data so that are some outliers :
#R code
df1 = data.frame(id = 1:100, ...
1
vote
1
answer
57
views
Ranking multi-column dataframe by row
I'm trying to rank order (row by row), from greatest to least, a multi-level column dataframe by specific columns (b_1 in this example). I'm hoping to do it in a way that would be dynamic, allowing ...
0
votes
0
answers
82
views
PowerBI Dax Column for Dynamic Top N + Others
I have the following columns and measures:
Columns
dimension
entity
Measures
CountOrder
DynamicRank - identify the top N entity based on CountOrder per Dimension.
TopNEntity - if DynamicRank is ...
0
votes
1
answer
25
views
Ranking a 3d netcdf file at each (x,y) location along the time axis
I'm guessing there are a number of ways of doing this - but any guidance appreciated. I have a netcdf file of temperature (x,y,t) and essentially want to return the time rank for each x,y position for ...
0
votes
1
answer
47
views
incorrect ranking power bi-dax
I HAVE AN ARRAY WITH THE FOLLOWING DATA
group mat value
1 a1 10
a2 23
a3 1
..
an 32
2 b1 10
b2 2
...
0
votes
0
answers
64
views
Adding p-value for Wilcoxon Signed Rank Test to box plots with 3 groups (repeated measures)
The dataset involves values measured at baseline and then two subsequent timepoints for the same group of participants; hence I wanted to run the Wilcox Signed Rank Test. I can create the box plots ...
0
votes
0
answers
65
views
data.table joins with on= and > or >= doesnt work and Order() function in r is not ordering correctly
I want to rank the dataset dt$myTime between dt.period$start_prev and dt.period$start. After that I want to declare the record with 1 using the rank fucntion to filter on it later.
Unfortunately I ...
0
votes
2
answers
127
views
dot graphviz Different ranking of nodes
I need to draw a complex control flow where the divisions into horizontal and vertical axies are important. Dot only allows you to set rankdir (LR, TB) and one perpendicular axis (using rank = same ) ...
0
votes
0
answers
24
views
I'm trying to calculate a similarity score, as a percentage, for two sequences of ranked preferences
So I need to find how similar 2 sequences of ranked preferences are and return a percentage.
In the sequences there will be ‘posts’ which are in the form of questions, for now there will only be 4 ...
0
votes
1
answer
39
views
Finding how to use "rank" or other similar grouping functions with conditionals in R
I am trying in R to perform a ranking or grouping with the following characteristics:
The content of the field: "Object" of the following record is equal to the content of the field: "...
0
votes
0
answers
87
views
How to calculate RANK based on Dates using DAX in a Matrix, when one column is coming from another table and DATE column is Dates table
I need to create a calculated column in a Matrix table, To flag a value when the First value is Cashflow column is negative, For Example in the screenshot A company 'Alliance' can have multiple ...
2
votes
1
answer
79
views
How to get iterate between all names and rank permutations in SQL
I have a table that contains a customer_id, the product they purchased, the timestamp of the purchase, and the rank of the purchase order. I want to know if there is a way in SQL to get overall ...
1
vote
0
answers
34
views
how to count occurrence of repeated elements in a panda column (Dataframe)? [duplicate]
I want to enumerate how many times an event occurs consequently without a break, if it breaks, the count will restart from the beginning, for example input Date and Event, the Count should be:
| Date |...
0
votes
2
answers
153
views
Filter data.table between multiple date ranges in R
since a few days I'm working with R and now I have my first problem. I am a complete beginner in R.
I want to check the data of dt between the **start date **and the end date and then write the start ...