Hello,
I am using previous function at group level but its not working for me as it is gathering information from details section rather than group itself. My data looks something like this
I grouped it by empid then by dept ID formula for interval is
if empid = previous (empid) then previous (date_out) - date_in
EMP ID Dept ID date_in date_out desc Interval
D 100 10 1/1/2014 1/5/2014 ABC
D 100 10 1/1/2014 1/5/2014 DEF
GF 100 10 1/1/2014 1/5/2014 ABC;DEF -4
D 100 20 1/10/2014 1/12/2014 ijk
D 100 20 1/10/2014 1/12/2014 lmn
GF 100 20 1/10/2014 1/12/2014 ijk;lmn -2
for EMPID 10 and deptID 20 I need previous date which is 1/5/2014 and the interval should be 1/10/2014 - 1/5/2014 = 5 but at the group level its picking 1/12/2014 - 1/10/2014 = -2.....
also for the first record as it has no predecessot interval should be null. I am not sure how to do this at group level.
Edited by achandana01 - 12 Mar 2014 at 5:19am