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 |
how does sas handle missing values in sort order? : Sas programming
what is sas application server? : Sas-di
How to test the debugging in sas?
what are the softwares and applications that are used most frequently used by sas bi applications developers? : Sas-bi
Name statements that are recognized at compile time only?
how to import XTP files into SAS datasets?
1 Answers Barclays, Institute For Plasma Research,
what has been your most common programming mistake? : Sas programming
How would you compile all macros from a folder in a study, within the autoexec program?
How to Rename Library?
How we can create SAS USER DEFINED CODE?
How to sort in descending order?
How long can a macro variable be? A token? : sas-macro