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
how does sas handle missing values in procs? : Sas programming
Explain data_null_?
where to use sas business intelligence? : Sas-bi
Explain the use of proc print and proc contents?
what is program data vector? : Sas-administrator
Explain the purpose of retain statement.
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 different between functions and PROCs that calculate the same simple descriptive statistics?
How do you control the number of observations and/or variables read or written? Approximately what date is represented by the SAS date value of 730?
Do you need to know if there are any missing values?
What are the functions which are used for character handling functions?
what is data governance? : Sas-di
how would you create a data set with 1 observation and 30 variables from a data set with 30 observations and 1 variable? : Sas programming
What does the RUN statement do?
if the Id has more then two transcatiion then show the first observation, IF Id has only two observation then It show both the observation