YQL Fantasy Hockey - League Standings by Month? - yql

I'm trying to gather league standings by month (or a custom time period)
I know how to do it for a specific date but can't seem to find a way to do from x to y
Is this possible? (other than repeating the query for each day I want)
Is is not a head to head or rotisserie league, just straight overall points.
Edit:
Example query:

No, there is no way to fetch by month or for a date range. If you look at the YQL table fantasysports.leagues.scoreboard, you can see the parameters only accept the optional week parameter. This matches the Yahoo! Fantasy Sports API docs (search for 'scoreboard') which shows it can give results for the current week, or another specified week.
I think this is because the Yahoo! Fantasy Sports scoreboards are all week-based, regardless of the actual frequency of games for the specific sport.
To capture scores by month, you can make several individual calls for each week.

Related

Google Sheets - Add Hours for All Instance of Names

I am rewriting a botched Google Sheet my wife uses for keeping track of kids who volunteer at her library. Each day, the kids select a Group from a drop-down, their name, and enter their time in and out. The main sheet calculates their total hours rounded as well as the total hours of the day and total number of kids who volunteered.
What she wants me to do now is list out all of the kids who are part of the volunteer program and calculate how many hours they volunteered this week. I'll end up getting a total hour count and etc, but for right now I need to figure out how to get all instances of "Kid A" and get the sum of their hours worked.
I was trying to use countifs but I am not sure that's the best function to use. Written as a formula, it'd be something like:
For-Each (name in C9:C74) Sum corresponding value in G9:74
So if Kid A worked 3 times, thus his name is listed 3 times, and his hour counts are 1.25, 2.5, and 0.75, next to his name I'd want it to return 4.5.
Example:
To make it even more simple, you can use SUMIFS...
=SUMIFS(G9:G74, C9:C74, "Kid A")
It's always easier to answer questions when you supply some representative data as part of the question, but 'blindly' based on your description you should be able to do the following to get the required answer:
=query(C9:G74,"select C,sum(G) group by C",0)

Find Number of Days in Current Month That Fall Between Date Range In Google Sheets

I'm trying to come up with a function that will calculate a monthly budget from within a specified date range. I tried to use SUMIFS but I can't figure out how to isolate a specific month within the range.
Example:
We have a sheet with Google Ad campaigns, with a row for each campaign.
We are running one Google Ad campaign (A) from 2/15/20 to 5/15/20 with a total budget of $3000 from which I calculate a daily budget of $33.33.
We are running a second campaign (B) from 5/15/20 to 8/15/20, also with a budget of $3,000, from which I calculate a daily budget of $32.61.
=IF(NOT(ISBLANK(Start_Date)),Total_Budget/(End_Date-Start_Date),"")
In a separate sheet, I have Budget and Spend fields for each month. For May, I need it to calculate the total budget for 5/1-5/15 of Campaign A, and 5/15-5/31 of Campaign B.
I got this far (J is the Daily_Budget, G is the Start_Date, and H is the End_Date):
=SUMIFS(Google!J2:J30, Google!G2:G30,"<="&DATE(2020,5,1),Google!H2:H30,">="&DATE(2020,5,31))
Then I was at a loss for how to extrapolate the number of days from the range, so that I could then multiply them by the Daily Budget and then add them together.
I thought of going back to the sheet that contains the campaigns and adding columns for each month with a complicated conditional, and then just using SUM(), but I feel like there has to be a more elegant solution.
UPDATE
Per request, here is a link to the spreadsheet with the desired results manually entered: Click here. May & June show the campaign partial month overlaps. The result I'm ultimately going for is =(15*Google!J2)+(16*Google!J3).
UPDATE 2 (24Jun20)
Per request, I have shared the spreadsheet so that people can make a copy and experiment with formulas: Click here..
Any ideas?
Thanks,
Ty
I would use the function DATEDIF() (documentation here). You can set the first parameter as the first day of the month you are trying to calculate the number of days within it, and the second as the first day from another month. Example:
DATEDIF(DATE(2020, 1, 1), DATE(2020, 2, 1), "D")
You could probably make a custom function with this as well to input only the number of each month (and year, in case of leap years on February), but I don't have much experience with that unfortunately.

How do I get the nearest past date in a range for each entry in another list?

I collect customer feedback for my education business and add it to a Google Sheet. The feedback data has a submission date (A2:A) and some satisfaction metrics, which I visualize in a Google Data Studio dashboard.
The problem is that I want the feedback per cohort, but not everyone fills in the feedback form on the same day. I have a list of all courses with their respective dates (Cohorts!A2:A), and I want to assign each feedback submission to their respective cohort in a new column. It would be nice to also match it to the specific course type and country, but for now matching the cohort date would suffice.
I've tried using VLOOKUP and ARRAYFORMULA to go through the feedback dates and get the nearest past date to take it as the "course date" for that student. All the solutions I've tried either only take a single date or TODAY as a reference, but I have a whole list I'd like to fill in.
From my understanding, you are trying to round the timestamp, then match it to your course table?
To round a timestamp to a date:
=INT($A2)
When doing lookups like you're describing, I frequently end up calculating the nearest week as well - this formula returns the Sunday of the week start. Figured it might be helpful.
=text($A2+CHOOSE(WEEKDAY($A2),0,-1,-2,-3,-4,-5,-6),"m/d/yyyy")

Google Sheets sorting by time

So I am in charge of office hours for a class at my University. I have to send out a google form every week for the students to sign up. The way the form is sent back, the data is grouped by Name, and the times they are available are grouped by days.
To make it easier on myself, I want to group it by times. Basically, I want it so that each day/time will have its own row, and the names of the people who want the time slot would be grouped together in the adjacent column.
I already separated the groups of times so that each time has its own cell, but I cannot figure out how to regroup the data by time.
I should also mention that each session of OH is 30 minutes and that each student can only receive one session of office hours a week because of limited availability. I also need to group the sessions into blocks so that the teachers won't have idle time (basically a teacher will have office hours from 5:00-6:30 PM on Tuesday, instead of 5:00-5:30 PM and 6:00-6:30 PM on Tuesday and 8:00-8:30 PM on Thursday). Grouping the names of the people who want office hours by the times that they are available would make it a lot easier to set up that week's office hours schedule.
Here's a link to an example:
https://docs.google.com/spreadsheets/d/1fRYYNUoEcgynU9cDMoXzsyjtIir4hsRlfFYJau36a78/edit?usp=sharing
have a look at this sheet ( i have only turned on sharing temporarily, co copy this to your own drive)
Look at the "matrix choices" sheet.
I created a Matrix of students and times (which I think is better), but there is also a list of names for each timeslot on the end too.
have a play changing some of the 1's (sessions applied for) to "G" (short for Granted). Ive set up some conditional formatting and data validation.

Retry: Neo4j Query on first query result to get insight in to what is returned

I had asked this question few days back but maybe as I was not clear as I didn't get much response.
let me try to rephrase my question to something like this:
I have few customers who are placing the orders with various products. and I am interested in knowing orders placed for various combinations of products and customers then bucket them into the number of orders last week, last fortnight, last month etc.
I am able to query the orders based on my criteria, but I am unable to understand how to then use this result in to data I need.
lets say my data is like this:
(c:Customer)<-[:PLACED_BY]-(o:Order)-[:HAS_PRODUCT]->(p:Product), (o)-[:PLACED_ON]->(d:Date)
and assuming that I have successfully found the Order's I am looking for, then how do I efficiently get the count i want out of these selected orders.
{... some queries that returns (o:Order) of interest ...}
With o
RETURN ??? as CountLastWeek, ??? as LastFortnight, ??? as LastMonth
BTW i also have OrderedDate property on the Order if that helps simplify the query.
is it even possible to achieve this in Cypher?
What you're looking to do is date time indexing. This is most certainly possible to achieve with Cypher.
You'll need to index your nodes via relationships. Each date is a day, you need to batch those into groups. Each day has a week that it is in, and a month that it is in. You just need to add in those groups to your dates and then aggregate on the collections of dates belonging to a week, a fort night, or a month.

Resources