BookmarkSubscribeRSS Feed
jen123
Fluorite | Level 6

I have a table called "test".  It contains all the employment applications received.  The dataset contains numerous rows for each application because each is reviewed by various people.  I wrote a code create a dataset containing data when each application was first reviewed.  Is there a way to do the same in query builder? Thanks!

1 REPLY 1
LinusH
Tourmaline | Level 20

Depends on how your source table look like (and how you solved in your program).

But if it can be solved in a single, fairly simple SQL, the chances are, yes, you might can.

If you have an application id, and a timestamp on each row which defines the time when the application was reviewed, you might do something like this:

  1. Define MIN as summary on your timestamp column
  2. Define the application id as Group By column. You'll have to un-check "Automatically Select groups" if you have other columns that you want to keep, other than the id.
  3. Define a Having condition that will filter out rows that has timestamp = min(timestamp):
  • Filter data - Filter Summarized Data - New Filter
  • Basic Filter
  • Select MIN_of_timestamp column from the data columns section
  • Define it as Equal to - Value - Columns - Timestamp

And run...

/Linus

Data never sleeps

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
  • 1 reply
  • 2490 views
  • 0 likes
  • 2 in conversation