Ranking in Spotfire with Multiple arguments - spotfire

New to spotfire here and have a question:
I need to rank people based on a few different criteria.
"Start_date" is the most important. If there is a tie for "start_date" I want to rank by "Age" and if there is still a tie because they started the same day and are the same age I want to then look at badge number as the final tie breaker.
All the RANK() function in spotfire produce a numeric ranking and tie breakers dont seem to be based on anything beyond min, max average.
Any help would be apprecaited!!

I mocked up some data:
I then created the following column:
rank(Concatenate([Start Date],[Age],[Bnumber]),"asc") as [Rank]
If I understand corectly, this should solve your needs. The first person has been there the longest, and wins the tie break based on age and then badge number. Whether age/badge number being the lowest or highest you did not specify. It then iterates until the last person has been there the shortest.

Related

Find how many people the person with the most units per alcohol per week lives with

I have the following data collected:
hhsize: household size
drating: totals units of alcohol per week
I am trying to find a function that tells me how many people live in the house where the individual who drinks the most units of alcohol per week lives.
I know how to find the individual that drinks the most:
=MAX(data!Q11:Q9291)
But not how to link the result to the hhsize.
EDIT: The answer must be formula or function based, i.e not generated solely by sorting or filtering.
You could edit the below to match your needs:
Formula in D1:
=#SORT(A2:B9,2,-1)
Note that the 2nd parameter holds the index of the column you wish to sort by. In my case '2', in yours it's probably '14'.
If you have Excel 365 than you can use this function:
=FILTER(data!A11:Q9291,data!Q11:Q9291 = MAX(data!Q11:Q9291))
Or to just return the two columns:
=CHOOSECOLS(FILTER(data!A11:Q9291,data!Q2:Q9291 =MAX(data!Q11:Q9291 )),1,17)
--- UPDATE ----
If you only want the first result:
=TAKE(CHOOSECOLS(FILTER(data!A11:Q9291,data!Q2:Q9291 =MAX(data!Q11:Q9291 )),1,17),1)

how to create a score based (or ranking based) column on excel?

my database
What I want to achieve: Find the city where my tv ads have the best performance (high volume of signups at a lower cost).
What I am doing: In order to see the best combination of the metrics, I attributed a score for each metric column. Then, I sum all the scores (column M). The highest score is the city with the best performance.
What I would like to do: To automate the score columns. Is the a way to make those scores with formulas or code? (the score goes from 1 to [number of lines]). Also, I'd love to know if theres a better way to make this correlation.
If it's a regular table, you can use RANK().
So, add a column like "rank" to your table.
and put this into the first row under "rank":
=RANK([#[Total Score]];[Total Score];0)
It basically takes the total score of the current row, and checks it's ranking in the whole "total score"-column. The zero is to give the highest value the lowest rank.
Have fun! ^_^

Getting the value of a cell from its relative position

I've recently been asked to create a spreadsheet for work that will return the lowest bid price from any of our suppliers. I got the basic spreadsheet from management and they want me to get it working. It looks like this
I've found the minimum value from the four pricing columns easily enough, but I need to get the vendor id and the deal number and display them on the right side as well, as this spreadsheet could have tens of thousands of entries.
Does anyone know of any method I could use to get the Vendor ID and Deal Number values from their relative position to the smallest price value?
This will give you the lowest price vendor.
=INDEX(B2:Q2,MATCH(R2,B2:Q2,0)-3)
Since Vendor appears three columns to the left of price, you are offsetting match by -3. For bid number you will offset by -2.
However, there is more than one vendor with the lowest price, you will get the one who appears first.

Ranking function

I am looking for some help regarding ranking. My spreadsheet has columns labeled as follows:
Tickers
P/E Rate of Change
P/B Rate of Change
Dividend Yield Rate of Change
P/Sales Rate of Change
I am looking to come up with a composite ranking that takes into account a tickers relative rank within each rate of change category. I tried this first by creating an additional 4 columns and using the formula as follows:
IFERROR(RANK(D4,$D:$D,1),"")
I believe this gives me a rank for the corresponding rate of change. However, for those cells that have either a blank or an error I want to use a median in calculating the tickers rank. I was then going to sum the ranks in another column to come up with my final ranking but that doesn't seem to be calculating correctly as I have blank rows returning rankings that don't make sense.
I think you are almost there.
For one column I would change what you have to
=IFERROR(RANK(D4,$D:$D,1),MEDIAN($D:$D))
Then simply expand to add all ranks together
=IFERROR(RANK(A4,$A:$A,1),MEDIAN($D:$D))
+IFERROR(RANK(B4,$B:$B,1),MEDIAN($D:$D))
+IFERROR(RANK(C4,$C:$C,1),MEDIAN($D:$D))
+IFERROR(RANK(D4,$D:$D,1),MEDIAN($D:$D))
+IFERROR(RANK(E4,$E:$E,1),MEDIAN($D:$D))
To avoid potentially large numbers you could use an average (same resulting rank, but potentially easier to understand) by slightly changing the formula to:
=(IFERROR(RANK(A4,$A:$A,1),MEDIAN($D:$D))
+IFERROR(RANK(B4,$B:$B,1),MEDIAN($D:$D))
+IFERROR(RANK(C4,$C:$C,1),MEDIAN($D:$D))
+IFERROR(RANK(D4,$D:$D,1),MEDIAN($D:$D))
+IFERROR(RANK(E4,$E:$E,1),MEDIAN($D:$D)))/5

find average of calculated field in cognos 10.1

I have a calculated field a/b which makes sense at week level, where a is last of period metric and b is sum of the period metric. I need to find avg(a/b) for the weeks that fall under a month and not end_of_month(a)/sum(b) for the month. I made my a/b metric with regular aggregate as calculated and then monthly average metric with regular aggregate as average, but it doesn't work. The report is a crosstab report. How can I solve this?
Edit: a is end on hand inventory, b is sales, a/b is weeks of supply. Both a and b spread along product/location/time dimensions. For a, I've set its regular aggregate for time as last.
Your form of expression gives me error, so, I tried average((total([a] for [week]))/(total([b] for [week]))) which is error-free but doesn't give correct result. I used total[a] because it still has to sum along other dimensions except time. Any ideas?
I was also trying an alternative way- get the individual weeks of supply and then derive a new metric as (first week wos + ...+fifth week wos)/5. But I get a warning when I try to put a case statement as "Relational query objects are being used in conjunction with Dimensionally-modeled relational objects", and the metric give garbage value. How can I apply case involving relational item in query items of measure dimension?
You have to be more clearer on what you are trying to achieve.
Also, the header says framework manager, while you are talking about report.
My best guess is you need to use the for expression in your aggregate the values:
avg((max([a] for [week]))/(sum([b] for [week])))
You might need to use other (more sophisticated) summary function
for more details about the FOR and AT look here:
Using the AT and FOR Options with Relational Summary Functions

Resources