What is LAG function?How is it used? can any one explain
Answers were Sorted based on User's Feedback
Answer / sheetal
lag function is used to look at the previous values as :
lag(<varaiable name>); gives you the the previous value .
Is This Answer Correct ? | 15 Yes | 2 No |
Answer / basha
hai gajari
this is basha from chennai no phones no mails why? what
happened man?
ok lets see answer
lag function returns value from que
ex:-
data gajari;
input chindhi 8. @@;
datalines;
1 2 3 4 5
;
run;
data rao;
set gajari;
chore=lag(chindhi);
run;
output:-
obs chndhi chore
1 1 .
2 2 1
3 3 2
4 4 3
5 5 4
ok bye
take care
basha
TVS F&S
Is This Answer Correct ? | 9 Yes | 0 No |
Answer / 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 |
Explain the message 'Merge has one or more datasets with repeats of by variables'.
Explain data_null_?
what are the softwares and applications that are used most frequently used by sas bi applications developers? : Sas-bi
when we are using the PROC TRANSPOSE? OBSERVATIONS are repeated then what will happen and what it will show in log window.
how can u convert this 25-jul-2010 from numeric to charcter?
The Lion King is hosting an animal conference. All the animals in the world attend except one. Which animal does not attend?
How you can read the variables that you need?
what is the difference between compiler and interpreter? give any one example (software product) that act as a interpreter?
36 Answers Accenture, College School Exams Tests, CTS, IBM, IHRD, Infosys, Sylhet Engineering College, TCS, Wipro,
"What is the difference between proc sort nodup and proc sort nodupkey?"
explain the main difference between the nodup and nodupkey options? : Sas-administrator
What is the difference between %local and %global?
Code a PROC SORT on a data set containing State, District and County as the primary variables, along with several numeric variables.