Joined: 26 Mar 2013
Online Status: Offline
Posts: 28
Topic: Formula for First time fix within 14 days Posted: 31 Oct 2014 at 3:33am
Good afternoon
Trying to work out a formula
I basically need to create within Crystal - the amount of days between the previous job finished and the next call logged - if this is more than 14 days this is should say "FTF" ( first time fixed ) if less then put "NULL"
This would need to be based on the same Serial No only - as this would have multiple Cust Order Numbers
Below is an example of some data based on the above
Customer order number Serial number Call Logged Count Actual Finish Date
0005267219 C517206 23/10/2013 29/10/2013
0005494652 C517206 27/12/2013 27/12/2013 59
0005650378 C517206 15/02/2014 17/02/2014 50
0005724493 C517206 09/03/2014 09/03/2014 20
The count at the end is the amount of days between the logged and finished date - which is what I need it to look like in crystal
I was thinking of using running total maybe - but any ideas would be good
Joined: 26 Mar 2013
Online Status: Offline
Posts: 28
Posted: 02 Nov 2014 at 9:58pm
thanks for this - doesn't seem to work though
Below is the example I have put in
if next({SSJOBH.Customer order number}) <> {SSJOBH.Customer order number}then '' else
if next({SSJOBH.Customer order number}) = {SSJOBH.Customer order number} and datediff('d',{@Actual Finish Date},next({@Call Logged}) > 14 'FTF' else 'NULL'
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 03 Nov 2014 at 3:31am
all of these are single quotes - you can use double if you want.
you are also missing a close parenth
if next({SSJOBH.Customer order number}) <> {SSJOBH.Customer order number}then '' else if next({SSJOBH.Customer order number}) = {SSJOBH.Customer order number} and datediff('d',{@Actual Finish Date},next({@Call Logged})) > 14 'FTF' else 'NULL'
Joined: 26 Mar 2013
Online Status: Offline
Posts: 28
Posted: 03 Nov 2014 at 4:12am
Thanks for that - this has worked but now has created another problem
The below is the formula I have in query
if next({SSJOBH.Serial number}) <> {SSJOBH.Serial number}then '' else
if next({SSJOBH.Serial number}) = {SSJOBH.Serial number} and datediff('d',{@Actual Finish Date},next({@Call Logged})) > 14 then 'FTF' else ''
The above is based on machine items - but if there is no record after the last one per machine item I need it also to say FTF - as this would mean we have had no more visits - as long as I haven't included it in the above query within 14 days
Also - lines that only have one logged call - has not been counted - so would need to be a FTF
I have sorted the data by Serial Number as there are multiple serial numbers - so the last one would be a FTF if no return
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