blob: c5199e64b07cea30068d5d9c565f6d8fdfd4fc74 [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 }
buyingyi3ca46d02015-01-27 23:22:09 -08004group by $sig_name := $sponsor.sig_name keeping $es
buyingyi2fd7fa62014-11-24 19:31:55 -08005with $sig_sponsorship_count := count($es)
6with $by_chapter :=
7 from $e in $es
buyingyi3ca46d02015-01-27 23:22:09 -08008 group by $chapter_name := $e.sponsor.chapter_name keeping $es
buyingyi2fd7fa62014-11-24 19:31:55 -08009 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 }