Attendance ============================ Properties ----------------- .. py:data:: q.LastSunday :return: The the most recent Sunday prior to today on which there are meetings with recorded attendance :rtype: datetime Functions ----------- .. py:function:: q.AttendanceTypeCountDateRange(progid, divid, orgid, attendtype, startdt, days) :return: The number of Attends filtered by the parameters. :rtype: int :param int progid: The ProgramId, use 0 for all. :param int divid: The DivisionId, use 0 for all. :param int orgid: The OrganizationId, use 0 for all. :param str attendtype: Comma separated list of Attendance Types, either names or ids. :param datetime startdt: Start Date for the attendance :param int days: Number of days to look forward In the program, division, organization of a particular attendtype starting at date and looking forward a number of days. See :ref:`UniqueAttends`. Example usage:: v1 = q.AttendanceTypeCountDateRange(0, 0, 0, "New Guest, Recent Guest, Visiting Member", '1/1/2014', 30) v2 = q.AttendanceTypeCountDateRange(0, 0, 0, "40,50,60", '1/1/2014', 30) v3 = q.AttendanceTypeCountDateRange(101, 0, 0, "All", '1/1/2014', 30) print """
Visitors using Descriptions {0:,}
Visitors using Ids {1:,}
All Attendance in Program 101 {2:,}
""".format(v1, v2, v3) .. py:function:: q.AttendCountAsOf(startdt, enddt, guestonly, progid, divid, orgid) :return: The unique number of people attending for the parameters :rtype: int :param datetime startdt: Meetings on or after this date :param datetime enddt: Meetings up to but not including this date :param bool guestonly: Only include guests if true :param int progid: ProgramId, use 0 for all. :param int divid: DivisionId, use 0 for all. :param int orgid: OrganizationId, use 0 for all. The **enddt** is exclusive (up to but not including). If the **enddt** does not have a time of day component, 24 hours will be added to the **enddt** to include all meetings for that day. Unlike most of the functions on this page, this function returns the unique number of people attending. Example usage:: v1 = q.AttendanceTypeCountDateRange(0, 0, 0, "New Guest, Recent Guest, Visiting Member", '1/1/2014', 30) v2 = q.AttendanceTypeCountDateRange(0, 0, 0, "40,50,60", '1/1/2014', 30) v3 = q.AttendanceTypeCountDateRange(101, 0, 0, "All", '1/1/2014', 30) print """
Visitors using Descriptions {0:,}
Visitors using Ids {1:,}
All Attendance in Program 101 {2:,}
""".format(v1, v2, v3) .. py:function:: q.AttendMemberTypeCountAsOf(startdt, enddt, membertypes, notmembertypes, progid, divid, orgid) :return: The total count of attendances for the parameters :rtype: int :param datetime startdt: Meetings on or after this date :param datetime enddt: Meetings up to but not including this date :param str membertypes: include these member types, blank for all. :param str notmembertypes: exclude these member types, blank for no exclusion. :param int progid: ProgramId, use 0 for all. :param int divid: DivisionId, use 0 for all. :param int orgid: OrganizationId, use 0 for all. The **membertypes** and **notmembertypes** can be a comma separated list of Member Types, either names or ids. See :ref:`UniqueAttends`. Example usage:: print """
        Total number of class leader attends: {0:,}
        Total number of class member attends: {1:,}
                     Total number of attends: {2:,}
        
""".format( q.AttendMemberTypeCountAsOf('1/1/14', '1/31/14', '', 'Member', 101, 0, 0), q.AttendMemberTypeCountAsOf('1/1/14', '1/31/14', 'Member', '', 101, 0, 0), q.AttendMemberTypeCountAsOf('1/1/14', '1/31/14', '', '', 101, 0, 0)) .. py:function:: q.LastWeekAttendance(progid, divid, starthour, endhour) :return: Count of Attends offset from the most recent sunday by the start and end hours :rtype: int :param int progid: ProgramId, use 0 for all. :param int divid: DivisionId, use 0 for all. :param int starthour: the number of hours to offset from Sunday at midnight :param int endhour: the number of hours to offset from Sunday at midnight (should be >= **starthour**) This function works like the Week at a Glance report is set up. The pivot date/time is the last Sunday at midnight for which there is attendance on that day. The start date and time then is the offset from the pivot by **starthour**. The end date and time is the pivot offset by **endhour**. An offset can be negative. -24 would on the **starthour** would include attendance for the Saturday before that pivot Sunday. For example:: print q.LastSunday print q.LastWeekAttendance(101, 201, -96, 72) This prints the date for the LastSunday followed by the count of attends looking back to the previous midnight Wednesday up to the following Wednesday midnight, covering a total of 7 days or 168 hours. .. py:function:: q.MeetingCount(days, progid, divid, orgid) :return: The number of meetings occuring within the parameters :rtype: int :param int days: Number of days to look back from the the current date and time :param int progid: The ProgramId, use 0 for all. :param int divid: The DivisionId, use 0 for all. :param int orgid: The OrganizationId, use 0 for all. .. py:function:: q.MeetingCountDateHours(progid, divid, orgid, startdt, hours) :return: The number of meetings occuring within the parameters :rtype: int :param int progid: The ProgramId, use 0 for all. :param int divid: The DivisionId, use 0 for all. :param int orgid: The OrganizationId, use 0 for all. :param datetime startdt: Starting date :param int hours: Number of hours to look forward from the **startdt** For Example:: dt = model.DateAddHours(q.LastSunday, -96) print q.MeetingCountDateHours(101, 0, 0, dt, 168) This would show the number of meetings for the seven days from Wednesday to Wednesday around the LastSunday. .. py:function:: q.NumPresent(days, progid, divid, orgid) :return: The number of recorded attendees for given parameters :rtype: int :param int days: Number of days to look back from the the current date and time :param int progid: The ProgramId, use 0 for all. :param int divid: The DivisionId, use 0 for all. :param int orgid: The OrganizationId, use 0 for all. For each meeting, this function uses the greater of the manually entered headcount, if available, or the count of attendees marked present. This way you can combine both worship and small groups where you would normally just enter a headcount on the worship service. See :ref:`UniqueAttends`. .. py:function:: q.NumPresentDateRange(progid, divid, orgid, startdt, days) :return: The number of recorded attendees for given parameters :rtype: int :param int progid: The ProgramId, use 0 for all. :param int divid: The DivisionId, use 0 for all. :param int orgid: The OrganizationId, use 0 for all. :param datetime startdt: Starting date :param int days: Number of days to look back from the the current date and time For each meeting, this function uses the greater of the manually entered headcount, if available, or the count of attendees marked present. This way you can combine both worship and small groups where you would normally just enter a headcount on the worship service. See :ref:`UniqueAttends`. .. _UniqueAttends: Number of Attendances vs Number of People ----------------------------------------- Unless otherwise noted, the functions returning a count of attendances on this page are giving the total number of attendances, **not** the number of unique people who attended. That is, if a person attended two different meetings, that would count for 2 in the total count. To get the unique number of people who attended regardless of how many times they attended, use Search Builder and the :func:`QueryCount` function.