I have two variables ID and Date. I need to get a max date value, tried everything but not able to find a way so please help me.
My requirement is to calculate and create a data item which should contain the latest data i.e. 17 Jan 2018 in the given sample data.
That data item will be used in a button bar to highlight Data Refreshed On.
I hope, I am making sense here.
Here is a previous discussion about max date in VA:
If you just want to display the max date in your report, you can use a rank to select the "top 1" date.
If you need to perform any calculations using the max date, you will need to create a column in your data query using the MAX() function.
Also in 8.2 or 7.4, you can display the timestamp of the most recent update to the data source in a Text object. (Search the doc for "Dynamic Text") But this is not necessarily the same thing as the max date in your data and I believe you cannot do any calculations with this value.
Let us know if this helps.
Create a new calculated item, use your date variabel and "treatAs" number. Set aggregation to max.
Add a button bar and set your date variabel as category, then rank and pick the highest 1 from your calculated variable.
This will make your button bar show only the highest date in your data.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.