Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Can someone help with the below?
I have the following data:
ID1 | ID2 | Date_received | Period | Rank_type1 | Rank_type2 |
P0021 | 761 | 6/18/20 | 1H20 | 3 | |
P0021 | 761 | 6/18/20 | 1H20 | 2 | |
P0021 | 761 | 11/24/20 | 2H20 | 5 | |
P9800 | 34512 | 8/24/20 | 1H20 | 8 | |
P9800 | 8/24/20 | 1H20 | 4 | ||
P9800 | 6/2/21 | 2H20 | 7 |
And below is the expected output:
ID1 | ID2 | Rank_type1 Current | Rank_type1 Previous | Rank_type2 Current | Rank_type2 Previous |
P0021 | 761 | 5 | 3 | 2 | |
P9800 | 34512 | 8 | |||
P9800 | 7 | 4 |
I used this expression: FirstSortedValue(DISTINCT Rank_type1), -Date_received
But I am only getting the current rank with this expression and also rank_type2 comes blank
ID1 | ID2 | Rank_type1 Current | Rank_type1 Previous | Rank_type2 Current | Rank_type2 Previous |
P0021 | 761 | 5 | |||
P9800 | 34512 | 8 | |||
P9800 | 7 |
@sunny_talwar @swuehl @Gysbert_Wassenaar @Anil_Babu_Samineni @tresesco
Kindly help
Thank you
What exact expression are you using for 'Rank_type1 Previous'? Could you share your sample app?
Current
FirstSortedValue(DISTINCT Rank_type1, -Date_received)
Previous
FirstSortedValue(DISTINCT Rank_type1, -Date_received, 2)
With those expressions I am getting the expected output.
Hi Tresesco,
I am not getting correct output.
I have created a sample file.
Below is the expected output:
Current output:
Would you be able to help?