Table | Python DSL | JSON DSL |
---|---|---|
Activity daily summaryactivity | Activity.col("$1") | { "activity": "$1" } |
Body summarybody | Body.col("$1") | { "body": "$1" } |
Sleep summarysleep | Sleep.col("$1") | { "sleep": "$1" } |
Workout summaryworkout | Workout.col("$1") | { "workout": "$1" } |
Meal summarymeal | Meal.col("$1") | { "meal": "$1" } |
Table | Python DSL | JSON DSL |
---|---|---|
Timeseries Resource fields | Timeseries.col("$1").field("$2") | { "timeseries": "$1", "field": "$2"} |
source_sport
is not a valid Source Column
expression in a query that is selecting from the Sleep resource.
Column | Python DSL | JSON DSL | Available in |
---|---|---|---|
Provider | Source.col("source_provider") | { "source": "source_provider" } | All Tables |
Source Type | Source.col("source_type") | { "source": "source_type" } | All Tables |
Source App ID | Source.col("source_app_id") | { "source": "source_app_id" } | All summary tables |
Workout ID | Source.col("source_workout_id") | { "source": "source_workout_id"} | Workout Stream timeseries only |
Sport | Source.col("source_sport") | { "source": "source_sport" } | Workout Stream timeseries only |
Table | Index | Python DSL | JSON DSL |
---|---|---|---|
Activity daily summaryactivity | Calendar date | Activity.index() | { "index": "activity" } |
Body summarybody | Measurement datetime | Body.index() | { "index": "body" } |
Sleep summarysleep | Session end datetime | Sleep.index() | { "index": "sleep" } |
Workout summaryworkout | Session start datetime | Workout.index() | { "index": "workout" } |
group_by
clause, each expression
in the group_by
clause creates a temporary Group Key Column (group_key.$OFFSET
). These temporary columns are then used to
facilitate the data grouping and aggregation as specified by your Query Instruction.
You can refer to these columns using the special Group Key Column expression:
Group Key Columns | Python DSL | JSON DSL |
---|---|---|
All | group_key("*") | { "group_key": "*" } |
The $N -th key | group_key($N) | { "group_key": $N } |