Summative issue

63 views
Skip to first unread message

John Currey

unread,
Nov 6, 2021, 11:15:50 AM11/6/21
to SDQL API
This query shows Hawaii has scored 40 points in three-straight games:
  • date,team,o:team,points,o:points@tS(points>=40,N=3)=3 and HD and season=2021
This query shows Hawaii has not scored 40 points in three-straight games:
  • date,team,o:team,points,o:points@team=HAW and season=2021
I didn't check all the teams in the first query, but at least the last three that show three-straight 40-point games, have not done so.

Here are the two URLs:

Joe Meyer

unread,
Nov 6, 2021, 5:21:38 PM11/6/21
to sdq...@googlegroups.com
John and API Friends,

Thank you for that fine example of bug reporting.
The expansion of the`tS` shortcut was losing the aggregator arguments (`N=3` in this case).
This is now fixed and your links are expected to work.

best regard,

Joe Meyer
Sports Database LLC

--

---
You received this message because you are subscribed to the Google Groups "SDQL API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sdqlapi+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sdqlapi/d7ed5bff-ef0f-4420-8867-255142050286n%40googlegroups.com.

John Currey

unread,
Nov 7, 2021, 9:43:38 AM11/7/21
to SDQL API
Hi,

I'm not sure it's correct yet. This shows teams that have covered the spread only once or fewer times in their last 8 games. As you can see, the list is unexpectedly long. 
  • date,team,o:team@team,tS(ats margin>0,N=8) <=1 and season=2021 and date<20211109
 As you can see, the list is unexpectedly long. Looking at the last team in the list, this shows the Steelers have covered the spread more than once in their last 8.
  • date,team,o:team,ats margin,points+line-o:points@team=Steelers and season=2021
URLs below:


Thanks. 

Joe Meyer

unread,
Nov 8, 2021, 8:47:37 AM11/8/21
to sdq...@googlegroups.com
John and API Friends,

thank you for the good debug message and links.
I see this as an important SDQL feature - not a bug.

Since the sum of nothing is zero, the aggregator Sum defaults to 0.
Your SDQL condition:
  tS(ats margin>0,N=8) <=1
is True when a team has played fewer than 8 games in the season.

To get what you want you can changing the default:
  tS(ats margin>0,N=8,default=None) <=1
 
or, since the average of nothing is None,
tA(ats margin>0,N=8) <=1/8

Best regards,

Joe Meyer




 

John Currey

unread,
Nov 8, 2021, 6:06:38 PM11/8/21
to SDQL API
Very cool! Thanks for the explanation, Joe.
Reply all
Reply to author
Forward
0 new messages