Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have the following table:
LOAD * INLINE [
Name, Value
A, 10
B, 5
C, 3
D, 4
E, 4
F, 5
G, 7
];
I would like to create a variable that returns the name of the 4th in the list when ranked.
It can't be done on load script.
Thanks for your help
I got it,
=only
(
if (
Aggr(
Rank(Sum(Value), 4, 1), [Name]) = 4, [Name]
)
)
using the option 4 in the rank function was key due to the values been the same.
4 = Lowest rank on first row, then incremented by one for each row.
Is Value itself rank or you want to create rank based on value?
=FirstSortedValue(Name, Value, 4)
Hi
Try something like this
In your example, there is no 4th rank. So I changed little bit.
Load * INLINE [
Name, Value
A, 10
B, 5
C, 3
D, 4
E, 4
F, 6
G, 7
];
= MaxString(Aggr(If(Rank(Sum(Value)) = 4,Name), Name))
I got it,
=only
(
if (
Aggr(
Rank(Sum(Value), 4, 1), [Name]) = 4, [Name]
)
)
using the option 4 in the rank function was key due to the values been the same.
4 = Lowest rank on first row, then incremented by one for each row.