Attendance¶
Properties¶
- q.LastSunday¶
- Returns:
The the most recent Sunday prior to today on which there are meetings with recorded attendance
- Return type:
datetime
Functions¶
- q.AttendanceTypeCountDateRange(progid, divid, orgid, attendtype, startdt, days)¶
- Returns:
The number of Attends filtered by the parameters.
- Return type:
int
- Parameters:
progid (int) – The ProgramId, use 0 for all.
divid (int) – The DivisionId, use 0 for all.
orgid (int) – The OrganizationId, use 0 for all.
attendtype (str) – Comma separated list of Attendance Types, either names or ids.
startdt (datetime) – Start Date for the attendance
days (int) – 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 Number of Attendances vs Number of People.
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 """ <table class="table" style="width: auto"> <tr><td>Visitors using Descriptions</td> <td>{0:,}</td></tr> <tr><td>Visitors using Ids</td> <td>{1:,}</td></tr> <tr><td>All Attendance in Program 101</td> <td>{2:,}</td></tr> </table> """.format(v1, v2, v3)
- q.AttendCountAsOf(startdt, enddt, guestonly, progid, divid, orgid)¶
- Returns:
The unique number of people attending for the parameters
- Return type:
int
- Parameters:
startdt (datetime) – Meetings on or after this date
enddt (datetime) – Meetings up to but not including this date
guestonly (bool) – Only include guests if true
progid (int) – ProgramId, use 0 for all.
divid (int) – DivisionId, use 0 for all.
orgid (int) – 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 """ <table class="table" style="width: auto"> <tr><td>Visitors using Descriptions</td> <td>{0:,}</td></tr> <tr><td>Visitors using Ids</td> <td>{1:,}</td></tr> <tr><td>All Attendance in Program 101</td> <td>{2:,}</td></tr> </table> """.format(v1, v2, v3)
- q.AttendMemberTypeCountAsOf(startdt, enddt, membertypes, notmembertypes, progid, divid, orgid)¶
- Returns:
The total count of attendances for the parameters
- Return type:
int
- Parameters:
startdt (datetime) – Meetings on or after this date
enddt (datetime) – Meetings up to but not including this date
membertypes (str) – include these member types, blank for all.
notmembertypes (str) – exclude these member types, blank for no exclusion.
progid (int) – ProgramId, use 0 for all.
divid (int) – DivisionId, use 0 for all.
orgid (int) – OrganizationId, use 0 for all.
The membertypes and notmembertypes can be a comma separated list of Member Types, either names or ids.
See Number of Attendances vs Number of People.
Example usage:
print """<pre> Total number of class leader attends: {0:,} Total number of class member attends: {1:,} Total number of attends: {2:,} </pre>""".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))
- q.LastWeekAttendance(progid, divid, starthour, endhour)¶
- Returns:
Count of Attends offset from the most recent sunday by the start and end hours
- Return type:
int
- Parameters:
progid (int) – ProgramId, use 0 for all.
divid (int) – DivisionId, use 0 for all.
starthour (int) – the number of hours to offset from Sunday at midnight
endhour (int) – 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.
- q.MeetingCount(days, progid, divid, orgid)¶
- Returns:
The number of meetings occuring within the parameters
- Return type:
int
- Parameters:
days (int) – Number of days to look back from the the current date and time
progid (int) – The ProgramId, use 0 for all.
divid (int) – The DivisionId, use 0 for all.
orgid (int) – The OrganizationId, use 0 for all.
- q.MeetingCountDateHours(progid, divid, orgid, startdt, hours)¶
- Returns:
The number of meetings occuring within the parameters
- Return type:
int
- Parameters:
progid (int) – The ProgramId, use 0 for all.
divid (int) – The DivisionId, use 0 for all.
orgid (int) – The OrganizationId, use 0 for all.
startdt (datetime) – Starting date
hours (int) – 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.
- q.NumPresent(days, progid, divid, orgid)¶
- Returns:
The number of recorded attendees for given parameters
- Return type:
int
- Parameters:
days (int) – Number of days to look back from the the current date and time
progid (int) – The ProgramId, use 0 for all.
divid (int) – The DivisionId, use 0 for all.
orgid (int) – 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.
- q.NumPresentDateRange(progid, divid, orgid, startdt, days)¶
- Returns:
The number of recorded attendees for given parameters
- Return type:
int
- Parameters:
progid (int) – The ProgramId, use 0 for all.
divid (int) – The DivisionId, use 0 for all.
orgid (int) – The OrganizationId, use 0 for all.
startdt (datetime) – Starting date
days (int) – 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.
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 QueryCount()
function.