value_macro expression:
Available Sleep Macros
You can combine multiple sleep macros in a single query and mix them with standard aggregations or other select expressions.
Example query
Chronotype
Determine the chronotype of each sleep session. Chronotype categories are based on the sleep midpoint time:- lark if midpoint ≥ 17:00 or ≤ 03:30
- third if midpoint ≤ 06:00
- owl otherwise
Get last chronotype of the week
Sleep Score
Calculate a Sleep Score (0 to 100) for each sleep session.Get mean sleep score of the week
Awake At / Asleep At
Pinpoint when a user first fell asleep and when they became fully awake during each sleep session. Theasleep_at macro returns the bedtime start adjusted by the recorded sleep latency, while awake_at returns the bedtime start plus the offset of the final non-awake sleep segment.