Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How can I get the last value per dimension in a straight table . so for
LOAD * INLINE [
Name, Score
A,10
B,2
C,30
A,15
B,5
D,70
];
expecting to get
Name Score
A 15
B 2
C 30
D 70
Thank you,
Raphael
With intervention in the script
LOAD RowNo() as Key,
*;
LOAD * INLINE [
Name, Score
A,10
B,5
C,30
A,15
B,2
D,70
];
Create a new Key field and use it like this
FirstSortedValue(Score, -Key)
You took the first value for B and Second value for A.... what is the logic here or do you want to show 5 for B?
Without intervention in the script, you can try this
Aggr(If(RowNo() = NoOfRows(), Score), Name, Score)
With intervention in the script
LOAD RowNo() as Key,
*;
LOAD * INLINE [
Name, Score
A,10
B,5
C,30
A,15
B,2
D,70
];
Create a new Key field and use it like this
FirstSortedValue(Score, -Key)
Many Thanks Sunny, as always you are saving the day!
Another way of doing this.
LOAD * INLINE [
Name, Score
A,10
B,5
C,30
A,15
B,2
D,70
]where Score <> 10 and Score <> 5;
Thanks.
A:LOAD * INLINE [
Name, Score
A,10
B,2
C,30
A,15
B,5
D,70
];
inner join
load max(Score) as Score,Name
Resident A
group by Name;