Hi all, I need some help to obtain the max value and previous max value for each unique ID. Below is my dataset. I used the calculated values and Rank but it does not seem to work by grouping by ID.
Can you tell us a little more about what you want to do? Do you just want to display the max value, or do you need to use the value in a calculated expression, etc?
I'm not sure what "previous max value" means if you do not have a date column.
A little more detail can help us help you.
The easiest way to do this in SAS Visual Analytics is apply a ranking to the report object. (Select the Ranks pane to make a ranking.) You can make a "top 2" ranking.
[this won't actually work for what you want, see below.]
Finding the second-greatest value in a VA expression might be trickier, although I'm sure there must be a way.
Let us know if a ranking will work for you.
I have also been trying and haven't found a solution yet. 🙂
The dev team doesn't know of a way to do this within VA's expression editor.
Let us know if you get something to work for you!
I created a feature request for this. It would be great if you could specify "by-group" as the context for a rank on a Ranks panel.
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.