What is LAG function?How is it used? can any one explain
Answer Posted / naveen
this Question was raised by saddi soorath....
lag function enables you to have the previous value.
we have the following data
Name num
Naveen 1
Naveen 2
Basha 1
Basha 2
so in data step
if u give num1 =lag(num) you will have the following result
Name num num1
Naveen 1 .
Naveen 2 1
Basha 1 .
Basha 2 1
Thanks and regards
Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What are the applications primarily used by business analyst? : Sas-bi
what is slowly changing dimension? : Sas-di
Is the physical structure of the data set in the same orientation as the report? Do you need to reshape the data sets? What method should you use to reshape the data–DATA steps,PROC TRANSPOSE,output data set from a procedure?
What is the work of tranwrd function?
What is the basic structure of a sas program?
how we can create a FLAG datasets? Ex:-ID age_group no_persons 1 to 10 10 to 20 3 11 to 20 21 to 30 7 21 to 3o 31 to 40 5
What are the data types does SAS contain?
what is factor analysis? : Sas-administrator
which date functions advances a date time or date/time value by a given interval? : Sas programming
What is auto call macro and how to create a auto call macro? What is the use of it? How to use it in sas with macros? : sas-macro
Mention common programming errors committed in sas ?
What are the difficulties u faced while doing vital signs table or dataset?
how to create the AE dataset by using SDTMIG specifications and SAP plan by using UNIX platform?
Will it bother you if the guy at the next desk times the frequency and duration of your bathroom or coffee breaks on the grounds that ?you are getting paid twice as much as he is??
What is the difference between using drop = data set option in data statement and set statement?