What is LAG function?How is it used? can any one explain

Answers were Sorted based on User's Feedback



What is LAG function?How is it used? can any one explain..

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

What is LAG function?How is it used? can any one explain..

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

What is LAG function?How is it used? can any one explain..

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

Post New Answer

More SAS Interview Questions

what is null hypothesis? why do you consider that?

0 Answers   Accenture, Quintiles,


What is the role of administrative users? : sas-grid-administration

0 Answers  


how we can call macros with in data step?

17 Answers   Allianz, ManPower,


is there any differnce between proc means and proc summary?

5 Answers  


What is difference between sas rename and lable?

4 Answers  






what is function of retain statment

0 Answers   PPD,


what is the use of sas management console? : Sas-di

0 Answers  


if x=round(26.3,10)-1 then x= how much and how explain?

5 Answers   BoA,


What is Linear Regression?

0 Answers  


what type of reports you are generating in your company...???

2 Answers   GSK GlaxoSmithKline,


Mention what is SAS data set?

0 Answers  


what is the difference between the SAS v8 and SAS v9?

7 Answers   TCS,


Categories