First time working with the Worklytics dataset? Try running these queries first.
1. Basic Metric Aggregation
How many strong collaborators did the typical team member have each week in August?
/* BASIC SAMPLE SQL QUERY 1UPDATED: 2024.09-19INPUT TABLE: {weekly_individual_aggregates}NOTE: QUERY HAS BEEN WRITTEN FOR USE IN BIGQUERY - THEREFORE CERTAIN FUNCTIONS MAY NEED TO BE ADJUSTED FOR USE IN ANOTHER ENVIRONMENT
*/WITHactiveEmployees AS (SELECTweek, employeeIdFROM {weekly_individual_aggregates}WHEREkey='worklytics:active:employees'ANDvalue=1.0GROUP BYweek, employeeId)SELECTweek, CEIL(AVG(value)) AS weekly_strong_collab_per_personFROM {weekly_individual_aggregates}JOIN activeEmployees -- filters on only employees that were active in a given weekUSING (week, employeeId)WHEREkey='collaborators:strong_count_distinct'-- filters on desired metricANDweekBETWEEN'2024-08-01'AND'2024-08-31'-- filters on desired date rangeGROUP BYweek;
Sample Query Output
Note that the above query can be quickly edited to show results for any of the metrics included in the dataset and any date range.
2. Basic Collaboration Analysis
How much time did the typical team member spend collaborating in slack in August? With how many collaborators?
/* BASIC SAMPLE SQL QUERY 2UPDATED: 2024.09-19INPUT TABLE:{collaboration_graph_split}NOTE: QUERY HAS BEEN WRITTEN FOR USE IN BIGQUERY - THEREFORE CERTAIN FUNCTIONS MAY NEED TO BE ADJUSTED FOR USE IN ANOTHER ENVIRONMENT
*/SELECTweek, SUM(weeklyCollaborationTimeMinutes) /COUNT(employeeIdSource) AS weekly_slack_collab_mins_per_person, COUNT(employeeIdTarget) /COUNT(DISTINCT employeeIdSource) AS weekly_slack_collaborators_per_personFROM {collaboration_graph_split}WHERE1=1AND sourceType ='slack'-- filters on slack collaboration only ANDweekBETWEEN'2024-08-01'AND'2024-08-31'-- filters on desired date rangeGROUP BY1ORDER BY1;
Sample Query Output
Note that the above query can be quickly edited to show results for any of the collaboration tools and any date range.