0 How setup metric to report small group attendance? 2 Ken Roach posted 9 Years Ago Im trying to set up a metric to report the number of people who attended small group by date of attendance. I've tried select startdatetime,count(*) from attendance where didattend=1 group by startdatetime but that does not work. Running this as SQL gives the following result set: 2/04/2015 10 7/04/2015 1 16/04/2015 5 22/04/2015 4 23/04/2015 4 26/04/2015 6 30/04/2015 13 How can I get this result set into the metrics table? Where does the metric get it's date from when you run an SQL command like 'select count(*) from person'?
Ken Roach 9 years ago Thanks David. I think there are two ideas here:Allow metrics to be completely reloaded over a period where the date of the metric can be specified in the select. This would drop all previous metrics and reload them from the select. This would cater for the scenario above, but not for a count of person (where there is no date for person), but would cater for a metric like 'The number of people added each month.'Import metrics from other metric tables generated elsewhere. This can be done from the backend using SQL but it might be nice to have a simple metric,date,measure (number) import function.I'll suggest both ideas to the black book (if they are not already in it.)
Kelley Langkamp 9 years ago Ken - Thank you! I was able to take that and tweak it for what I needed. My only concern is that if the workflow runs every time attendance is updated it is going to be running constantly on Sunday morning when all our kids check-in. Any ideas? I thought about filtering the workflow trigger on DeviceId but wasn't sure if you could filter so it only runs on null?
Ken Roach 9 years ago Hi Keley, great to hear it helped. If check-in uses the Attendance table then this is not a good idea - you don't want it firing on every checkin. (We are not using Check-in yet.)You could try using the statement early in the workflow -select datepart(dw,GETDATE() )put the result into a workflow variable (DayOfWeek), andselect datepart(hh,GETDATE() )put the result into a workflow variable (HourOfDay), and thencheck if DayOfWeek=1 and HourOfDay < 13 then DONT do the next workflow steps.(or consider the SQL CASE statement -SELECTCASE DATEPART(dw,GETDATE())WHEN >1 THEN (.... )ENDAnyone else have a better idea? Can someone confirm if check-in does use the group Attendance table?
Kelley Langkamp 9 years ago Ken, Check-in does use the Attendance table. I saw all the entries last night while I was working on this. I ended up deciding to run it as a job that fires every 30 minutes. That is accurate enough for our small groups pastor to see. It is far more timely than when he was waiting on paper attendance to get collected and entered into the old system!
Ken Roach 9 years ago An even better way would be to allow for a workflow to be run before someone views the metric. That way, it only runs when someone goes to view the metric, and doesn't continually run in the background when no-one cares.