Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all,
Just have a question to get the 2nd nearest date without using Max(Date,2).
Currently, I use the following syntax to get Sum(Shares) on the nearest date, and it woks fine.
Sum(Aggr(Sum({$< Report_Date={"$( =Max(Report_Date) )"} >} Shares), Security_ID) )
However, when I tried to get the 2nd nearest date without using Max(Date,2) for some concerns, I used the following syntax
Max({< Report_Date={ "<=$(=Date(Max(Report_Date)-1,'YYYY/MM/DD'))" } >} Report_Date)
to replace
Max(Report_Date)
But it didn't work, is anyting wrong here?
It's appreciated if someone can help me out here.
The data format should be same as Access format as "yyyy/m/d".
Just an aside, but I never knew max() had a rank parameter.
- Thanks for enlightening me.
Thanks, it works well in char.
Thanks for the lines, just realised the error may be caused by "".
However, I didn't succeed by using the line above, but it works OK with the following lines,
but I have no idea why it works.
Sum(Aggr(Sum({$< Report_Date={"$(=Max({<Report_Date={'<$(=Max(Report_Date))'}>} Report_Date))"} >} Shares)
, Security_ID) )