Vital Stats Report ================== Below is the explanation of the standard Vital Stats script. The numbers produced are not meant to reconcile with your books since the starting and ending dates would not correspond to cutoff dates for bookkeeping. To customize your own `VitalStats`: * In `Special Content` create a PythonScript file called `VitalStats`. * Copy the script code from this link: :doc:`Files/VitalStatsScript`, or from `GitHub `_ * Paste that into the PythonScript file you just created. * Modify it as you want and save it. * If you want to go back to the standard, just delete the VitalStats script you just created. Explanation of Contribution numbers computed -------------------------------------------- We use `fundid` 0 by default which indicates all funds. However, you can limit that to your general tithe fund if you want, by replacing the zero with the appropriate Fund ID#. .. literalinclude:: Files/VitalStats.py :lines: 48 :lineno-start: 48 :linenos: Next, we define some terms we will use for date arithmetic to get start and end dates. .. literalinclude:: Files/VitalStats.py :lines: 50-57 :lineno-start: 50 :linenos: In the next two statements, we get the total amounts and counts between the date starting two weeks ago up to one week ago. If today is the 18th, then that would be from the 4th up to the 11th. We do this so that you can run the report on any day of the week and see a full 7 days contributions. Otherwise, you would get an incomplete week if you just looked back 7 days, since data is likely still being entered for the current week .. literalinclude:: Files/VitalStats.py :lines: 59-60 :lineno-start: 59 :linenos: The next two statements get a total count of contributions for 52 weeks. This will be used to get the average size of a gift, not the average total for a donor. .. note:: The backslash `\\` characters indicate the statement continues on the next line. .. literalinclude:: Files/VitalStats.py :lines: 62-65 :lineno-start: 62 :linenos: The statement gets the weekly average of the total contributions for the past 4 weeks starting 5 weeks ago, up to 1 week ago. .. literalinclude:: Files/VitalStats.py :lines: 67-68 :lineno-start: 67 :linenos: The next two statements get the weekly average of the total contributions for a year. It compares the most recent year with the year before. .. literalinclude:: Files/VitalStats.py :lines: 70-73 :lineno-start: 70 :linenos: These statements allow you to display the date range used which is useful for reconciling the numbers. .. literalinclude:: Files/VitalStats.py :lines: 75-78 :lineno-start: 75 :linenos: