blob: d094e7eb53ddd836b1203b0f2a6a9973b3ede165 [file] [log] [blame]
buyingyi2fd7fa62014-11-24 19:31:55 -08001from $event in dataset('Event')
2from $sponsor in $event.sponsoring_sigs
3with $es := { "event": $event, "sponsor": $sponsor }
4group by $sig_name := $sponsor.sig_name with $es
5with $sig_sponsorship_count := count($es)
6with $by_chapter :=
7 from $e in $es
8 group by $chapter_name := $e.sponsor.chapter_name with $es
9 select { "chapter_name": $chapter_name, "escount" : count($es) }
10order by $sig_sponsorship_count desc
11limit 5
12select { "sig_name": $sig_name, "total_count": $sig_sponsorship_count, "chapter_breakdown": $by_chapter }