Help Determining time within a few cases

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Help Determining time within a few cases

Stella Vasquez

I’m needing some help.  Every time a juvenile is seen doing a good deed, his bracelet is scanned and entered in a database ( a few cases below)

I’m trying to omit the tickets that were within a 5 minute time frame. Any suggestions on how to write a syntax for this. I have 701584 cases involving 694 juveniles (IDNO)

 

 

Ticket#

IDNo

ShowingRespect

ObservingMindfulness

UsingHonesty

Being Driven

IssuedDateTime

697579

032243

1

0

0

0

22-Sep-2014 08:06:49

698065

032243

0

1

0

0

22-Sep-2014 09:26:49

698348

032243

1

0

0

0

22-Sep-2014 10:28:53

698408

032243

0

0

0

1

22-Sep-2014 10:53:18

698738

032243

0

0

0

1

22-Sep-2014 13:16:06

699406

032243

0

0

0

1

22-Sep-2014 15:37:00

699437

032243

0

0

1

0

22-Sep-2014 15:42:51

700170

032243

1

0

0

0

22-Sep-2014 17:57:57

701054

032243

0

1

0

0

23-Sep-2014 06:54:50

701063

032243

0

1

0

0

23-Sep-2014 06:55:28

701153

032243

0

1

0

0

23-Sep-2014 07:27:54

701197

032243

0

1

0

0

23-Sep-2014 07:32:54

702042

032243

1

1

0

0

23-Sep-2014 09:56:53

702322

032243

0

1

0

0

23-Sep-2014 11:25:12

702607

032243

0

0

1

1

23-Sep-2014 13:20:12

702876

032243

1

0

0

0

23-Sep-2014 14:25:35

681441

032244

1

1

0

0

16-Sep-2014 15:23:34

682059

032244

1

1

0

0

16-Sep-2014 19:02:12

682709

032244

1

0

0

0

17-Sep-2014 07:16:44

682761

032244

0

0

0

1

17-Sep-2014 07:23:16

684368

032244

1

1

0

0

17-Sep-2014 14:23:39

684389

032244

0

1

0

0

17-Sep-2014 14:27:56

685116

032242

0

1

0

0

17-Sep-2014 17:34:51

685659

032242

1

1

0

0

17-Sep-2014 19:44:51

686241

032242

0

1

0

0

18-Sep-2014 06:56:19

686381

032242

0

1

0

0

18-Sep-2014 07:23:03

686465

032242

0

1

0

0

18-Sep-2014 07:33:19

686530

032242

0

0

0

1

18-Sep-2014 07:50:15

686547

032242

0

0

0

1

18-Sep-2014 07:52:35

687062

032242

0

1

0

0

18-Sep-2014 09:59:25

687067

032242

1

0

0

0

18-Sep-2014 09:59:37

687072

032242

1

0

0

0

18-Sep-2014 09:59:57

687317

032242

1

0

0

1

18-Sep-2014 10:54:29

689239

032242

0

0

0

1

19-Sep-2014 06:25:00

689289

032242

0

0

0

1

19-Sep-2014 06:35:11

 

 

Stella Vasquez

Research & Development

(602) 542-2272

 



**The information contained in this communication is privileged and confidential and is intended solely for the individual[s] and/or entities named herein. This information is not to be disseminated. If you have received this message in error, please reply to the sender and notify the sender of the error and then permanently delete the message and sent item. Thank you.**
===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Help Determining time within a few cases

David Marso
Administrator
Look at the LAG and DATEDIFF functions in the FM!
That will provide sufficient information.
Stella Vasquez wrote
I'm needing some help.  Every time a juvenile is seen doing a good deed, his bracelet is scanned and entered in a database ( a few cases below)
I'm trying to omit the tickets that were within a 5 minute time frame. Any suggestions on how to write a syntax for this. I have 701584 cases involving 694 juveniles (IDNO)

<SNIP data Long format>
Stella Vasquez
Research & Development
(602) 542-2272


________________________________
**The information contained in this communication is privileged and confidential and is intended solely for the individual[s] and/or entities named herein. This information is not to be disseminated. If you have received this message in error, please reply to the sender and notify the sender of the error and then permanently delete the message and sent item. Thank you.**

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: Help Determining time within a few cases

MLIves
In reply to this post by Stella Vasquez

Stella,

There are likely several ways to do this, but one that comes to mind is to calculate the time difference then select the ones that are not 0-5 min from the last.

 

*** Set the value to 0 (will be 0 for all first IDNo).

Compute TimeDiff=0.

*** Calculate time differences if IDNo is the same.

If (IDNo=lag(IDNo))  TimeDiff=DATEDIF(IssuedDateTime, lag(IssuedDateTime), "minutes").

Execute.

*** Add any other edits/checks you may need.

Compute Keep=( timediff=0 or timediff>5).

Sel if Keep=1.

 

Melissa

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Stella Vasquez
Sent: Tuesday, September 23, 2014 7:27 PM
To: [hidden email]
Subject: [SPSSX-L] Help Determining time within a few cases

 

I’m needing some help.  Every time a juvenile is seen doing a good deed, his bracelet is scanned and entered in a database ( a few cases below)

I’m trying to omit the tickets that were within a 5 minute time frame. Any suggestions on how to write a syntax for this. I have 701584 cases involving 694 juveniles (IDNO)

 

 

Ticket#

IDNo

ShowingRespect

ObservingMindfulness

UsingHonesty

Being Driven

IssuedDateTime

697579

032243

1

0

0

0

22-Sep-2014 08:06:49

698065

032243

0

1

0

0

22-Sep-2014 09:26:49

698348

032243

1

0

0

0

22-Sep-2014 10:28:53

698408

032243

0

0

0

1

22-Sep-2014 10:53:18

698738

032243

0

0

0

1

22-Sep-2014 13:16:06

699406

032243

0

0

0

1

22-Sep-2014 15:37:00

699437

032243

0

0

1

0

22-Sep-2014 15:42:51

700170

032243

1

0

0

0

22-Sep-2014 17:57:57

701054

032243

0

1

0

0

23-Sep-2014 06:54:50

701063

032243

0

1

0

0

23-Sep-2014 06:55:28

701153

032243

0

1

0

0

23-Sep-2014 07:27:54

701197

032243

0

1

0

0

23-Sep-2014 07:32:54

702042

032243

1

1

0

0

23-Sep-2014 09:56:53

702322

032243

0

1

0

0

23-Sep-2014 11:25:12

702607

032243

0

0

1

1

23-Sep-2014 13:20:12

702876

032243

1

0

0

0

23-Sep-2014 14:25:35

681441

032244

1

1

0

0

16-Sep-2014 15:23:34

682059

032244

1

1

0

0

16-Sep-2014 19:02:12

682709

032244

1

0

0

0

17-Sep-2014 07:16:44

682761

032244

0

0

0

1

17-Sep-2014 07:23:16

684368

032244

1

1

0

0

17-Sep-2014 14:23:39

684389

032244

0

1

0

0

17-Sep-2014 14:27:56

685116

032242

0

1

0

0

17-Sep-2014 17:34:51

685659

032242

1

1

0

0

17-Sep-2014 19:44:51

686241

032242

0

1

0

0

18-Sep-2014 06:56:19

686381

032242

0

1

0

0

18-Sep-2014 07:23:03

686465

032242

0

1

0

0

18-Sep-2014 07:33:19

686530

032242

0

0

0

1

18-Sep-2014 07:50:15

686547

032242

0

0

0

1

18-Sep-2014 07:52:35

687062

032242

0

1

0

0

18-Sep-2014 09:59:25

687067

032242

1

0

0

0

18-Sep-2014 09:59:37

687072

032242

1

0

0

0

18-Sep-2014 09:59:57

687317

032242

1

0

0

1

18-Sep-2014 10:54:29

689239

032242

0

0

0

1

19-Sep-2014 06:25:00

689289

032242

0

0

0

1

19-Sep-2014 06:35:11

 

 

Stella Vasquez

Research & Development

(602) 542-2272

 

 


**The information contained in this communication is privileged and confidential and is intended solely for the individual[s] and/or entities named herein. This information is not to be disseminated. If you have received this message in error, please reply to the sender and notify the sender of the error and then permanently delete the message and sent item. Thank you.**

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD



This correspondence contains proprietary information some or all of which may be legally privileged; it is for the intended recipient only. If you are not the intended recipient you must not use, disclose, distribute, copy, print, or rely on this correspondence and completely dispose of the correspondence immediately. Please notify the sender if you have received this email in error. NOTE: Messages to or from the State of Connecticut domain may be subject to the Freedom of Information statutes and regulations.

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD