Exploring, predicting and reporting with SAS Visual Analytics and SAS Visual Statistics

how to use First obs and obs option in SAS VA

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 6
Accepted Solution

how to use First obs and obs option in SAS VA

[ Edited ]

Hello,

 

Anyone can help me how i can use first obs and obs option in SAS Visual Analytics in Query builder?

 

Thanks in Advance.


Accepted Solutions
Solution
‎11-24-2017 10:43 AM
Super User
Super User
Posts: 9,862

Re: how to use First obs and obs option in SAS VI

"Query Builder" utilises SQL technology.  SQL does not have any concept of first and last, nor in fact of observation order.  You must logically find a certain row.  So for instance if in a datastep you had first and last of dates within ID, and they were sorted sequentially and they were unique, the "first" row would logically be identified by date=min(date) group by id.  The "last" record would be logically identified by date=max(date) group by id.  It is irrelevant to the SQL parser if the "last" record appears as first, or second or anywhere in the data, only logical identification is used.

View solution in original post


All Replies
Solution
‎11-24-2017 10:43 AM
Super User
Super User
Posts: 9,862

Re: how to use First obs and obs option in SAS VI

"Query Builder" utilises SQL technology.  SQL does not have any concept of first and last, nor in fact of observation order.  You must logically find a certain row.  So for instance if in a datastep you had first and last of dates within ID, and they were sorted sequentially and they were unique, the "first" row would logically be identified by date=min(date) group by id.  The "last" record would be logically identified by date=max(date) group by id.  It is irrelevant to the SQL parser if the "last" record appears as first, or second or anywhere in the data, only logical identification is used.

Occasional Contributor
Posts: 6

Re: how to use First obs and obs option in SAS VI

Thankyou for your answer.

This will help me i am sure.
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 263 views
  • 1 like
  • 2 in conversation