Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Previous function at group level using date field Post Reply Post New Topic
Author Message
achandana01
Groupie
Groupie
Avatar

Joined: 20 Jul 2011
Online Status: Offline
Posts: 59
Quote achandana01 Replybullet Topic: Previous function at group level using date field
    Posted: 12 Mar 2014 at 4:52am
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
chand
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.