BookmarkSubscribeRSS Feed
ncsthbell
Quartz | Level 8

The data I am retrieving in the EG project has multiple rows for a 'Vendor# &  'Invoice#'.  Each of these rows has a column with a date field 'Last_updated'.  I need to be able to retrieve the row for this Vendor#/Invoice# with the latest date in  the 'Last_updated'.  I am trying to build this using EG query builder but I do not see a function that I can use to accomplish this. Any suggestions on how to accomplish this in EG?

THanks

4 REPLIES 4
Technolero
Pyrite | Level 9

On the Select Data tab, choose Vendor# and Invoice# and Last_updated.  In the Last_updated row, select MAX from the Summary column.  EG will automatically do summarization of the latest date by Vendor# and Invoice#.

ncsthbell
Quartz | Level 8

This works if I only include the Vendor & Invoice number.  I have many more columns of data that I need, the Vendor & Invoice number are just keys that I would be looking to group by.  I put the other columns on my select tab and since it is looking at each column on the select, I did not get what I need.  I should have mentioned that I have other data I need on the select tab and the 'grouping' used for finding the lastest dated row would be by vendor# and invoice#. 

Technolero
Pyrite | Level 9

I would run the query that I described above, then use that output to join back to your original data set to select the rows that match Vendor#, Invoice#, and Last_Updated.

ncsthbell
Quartz | Level 8

Thanks, I'll try that.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 3132 views
  • 6 likes
  • 2 in conversation