Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have plain data set with PORTFOLIOPERIOD, setup like 202212 where we have the year and the month, another field that is ID and a third being a concatenate of several columns from each line.
I need to find 2 strings for the concatenation, one where PORTFOLIOPERIOD is the highest in the set and with the highest ID within that period. The other is where PORTFOLIOPERIOD is the second highest in the set and also here again, the concatenated string with the highest ID in that period.
Max(ID,1) and Max(ID,2) work fine but I want the concatenated output and not just the ID. A 'max' over the string does not work. A MaxString over the concatenation also works but there is no such thing as MaxString(Description,2).
Any suggestion?
Thanks!
use FirstSortedValue()
Highest
= FirstSortedValue( ID & ' - ' & PERIOD , -ID, 1 )
Second Highest
= FirstSortedValue( ID & ' - ' & PERIOD , -ID, 2 )
use FirstSortedValue()
Highest
= FirstSortedValue( ID & ' - ' & PERIOD , -ID, 1 )
Second Highest
= FirstSortedValue( ID & ' - ' & PERIOD , -ID, 2 )