6 Replies Latest reply on Jun 30, 2014 9:31 AM by philmodjunk

    Activity analysis

    tays01s

      Title

      Activity analysis

      Post


           I have a series of activities I would like to record as I work. I was thinking of having a button for each activity that would start a 'timer'. When a new button (activity) or a stop button is pressed it stops the timer on the last activity; an activity button would start the new activity's timer. Thus 'Activities'.......<Activity records.

           Each record can easily have a creation time, but what's the neatest way to get the:

           a) stop time (and thus time elapsed) and

           b) sum all the times for each specific activity?

        • 1. Re: Activity analysis
          philmodjunk

               Make each activity a separate record. The button need not run a script more complex than:

               Set field [ Activities::StopTime ; Get ( currentTime ) ]
               New Record/Request

               Where a field named StartTime can auto-enter the creation time.

               StopTime - StartTime will compute the elapsed time in seconds.

          • 2. Re: Activity analysis
            philmodjunk

                 A summary field is one of several methods that can compute the total elapsed time.

            • 3. Re: Activity analysis
              tays01s

                   So are you saying have buttons for say 'Walking', each would have the script:

                   Set field [ Activities::StopTime ; Get ( currentTime ) ]
                   New Record/Request

                   I take it I'd still need a stop button with:

                   Set field [ Activities::StopTime ; Get ( currentTime ) ]

                   to complete the last record?

              • 4. Re: Activity analysis
                philmodjunk

                     Set field [ Activities::StopTime ; Get ( currentTime ) ]
                     New Record/Request

                     IS the script to perform with the stop button. No added script should be needed though additional steps are likely needed to get everything working.

                     If you need to label the activity in the newly created record, you can add another set field step that assigns a value to a field to identify the activity.

                     And you'll need an If block to keep from adding a new record when the last activity in your list has been completed.

                     But you may also want to set up a list of records and use a script that simply logs the start time once in each activity record with a special "halt" activity record to mark the end of the list.

                     Calculations can use the start time from the next record in the list to compute elapsed time for that activity in a calculation field. A summary field can then compute a total or even a running total fo that calculation.

                • 5. Re: Activity analysis
                  tays01s

                       Labelling different activities: I've used an 'Activities' in a portal from a related table, with an 'Activity list' that is chosen from a radio-button.

                       Start: I was going to have a script attached to a related date field that when modified would begin a day's activities.

                       Stop: Is it reasonable to use this within the Activities field with a script to begin/ end a series of activities.

                        

                       2 queries:

                       a) Time would be automatically calculated from use of the Activities field. However, i) I need to show a cumulative result and ii) people makes mistakes (eg. forget to switch activity and thus get an inaccurate record). How to achieve both i) and allow a manual override if ii) occurs.

                       b) I need to export/import a person's activity record. ie. the person is record in the Activity_person table < Activity_dates < Activities. I can see how a script can easily export a text file for a single table, but are there any examples showing how to export/import records from several related tables?

                  • 6. Re: Activity analysis
                    philmodjunk

                         a) cumulative totals can be computed with summary fields. From a related parent table, the sum function may also be used.

                         Your scripts are setting a time field to a value. If a user error is made, you can correct this simply by manually editing the time in this same field if you have any clear idea what time should be entered.

                         If you have this type of relationship "chain":

                         Table1---<Table2----<Table3 (---< means one record on the left matches to "many" records on the right)

                         Then you can export data from a layout based on Table3 and yet include any needed field from Table 2 and Table 1 as part of your import. You'll find that the dialog that you use for setting up the import allows you to select fields from related tables.