WKO5 Expression Reference

Functions

Conditional

  • has(string, substring)

    Check if a string contains the substring.

    Parameters

    string

    The string to check

    substring

    The substring to search for

    Return Value

    Returns 1 if the substring is found within string, otherwise 0.

    Discussion

    The search is not case sensitive, so "vo2max" will match a title that contains "VO2MAX" or "VO2max" too. The has function is most often used as part of the condition part of the if function.

    Athlete Level Examples

    if(has(title, "vo2max"), tss)

    Gives TSS for all workouts that have vo2max in the title.

  • hastag(string)

    Check if a workout has the specified tag.

    Parameters

    string

    The tag to check.

    Return Value

    Returns 1 if the workout has the tag, otherwise 0.

    Discussion

    A workout can have zero or more tags. This function returns 1 if string is equal to one of the workout's tags. The search is not case sensitive, but string must match the entire tag. The hastag function is most often used as part of the condition part of the if function.

    Athlete Level Examples

    if(hastag("edge800"), distance)

    Gives distance for all workouts that have the EDGE800 tag.

    if(hastag("race"), if)

    Gives the intensity factor for all workouts that have the RACE tag.

    pdcurve(meanmax(if(hastag("kickr"),power)))

    Gives a Power-Duration curve for only those workouts with the tag kickr.

  • if(condition, truevalue)

    Check a condition and give truevalue if the condition is true.

    Parameters

    condition

    The condition to check.

    truevalue

    The value to use if condition is true.

    Return Value

    Returns truevalue if condition is true, otherwise returns --.

    Discussion

    This function allows you to include or exclude values from a set based on a condition, thus transforming or creating a subset of the data.

    Workout Level Examples

    if(cadence>0 and cadence<50, cadence)

    Gives all cadence values that are greater than zero but less than 50.

    avg(if(power>bikeftp, power))

    Gives the average of all power values that exceed the Bike FTP for that workout.

    Athlete Level Examples

    if(max(power)>1000, date)

    Gives the workout date & time for all workouts that have maximum power over 1000W.

  • if(condition, truevalue, falsevalue)

    Check a condition and give truevalue if the condition is true, or falsevalue if the condition is false.

    Parameters

    condition

    The condition to check.

    truevalue

    The value to use if condition is true.

    falsevalue

    The value to use if condition is false.

    Return Value

    For each value in condition, returns truevalue if is true, otherwise returns falsevalue.

    Discussion

    This function allows you to choose values from two different data sets depending on a condition.

    Athlete Level Examples

    if(date < today, tss, plannedtss)

    Gives completed TSS values for workouts prior to today, but planned TSS values for workouts today or in the future.

  • isvalid(numbers)

    For one or more numbers, returns one (true) if it is valid, or zero (false) if it is not a number (na).

    Parameters

    numbers

    The numbers to check.

    Return Value

    Returns 1 if the number is a valid number, otherwise 0.

    Discussion

    In some cases a number is missing, which is different than zero. For example, if a bike workout doesn't have a power channel, then the average power is not zero, it is missing. Numbers that are missing are equal to the constant na which stands for not available or not a number.

    Examples

    isvalid(na)

    Gives 0.

    isvalid(0)

    Gives 1.

    isvalid({na, 0, 456, 1/0})

    Gives {0, 1, 1, 0}.

    sum(if(isvalid(power), deltatime))

    Gives the number of seconds for which there are valid power numbers.

Date

  • date(value)

    Converts a weekvalue, monthvalue, or yearvalue to a date.

    Parameters

    value

    A weekvalue, monthvalue, or yearvalue.

    Return Value

    A datevalue.

    Discussion

    If you convert a datevalue using a weekvalue, monthvalue or yearvalue function, you can convert it back to a datevalue. This can be useful if you want to do arithmetic on a weekvalue, monthvalue or yearvalue and convert back to a date.

    Examples

    date(trunc(weekval(today))+1)

    Gives the date of the first day of next week. You pick which day of week is first (Sunday, Monday, ...) using WKO Preferences.

    date(trunc(monthval(today))+1)-1

    Gives the date of the last day of the current month.

    date(trunc(yearval(today)))

    Gives the first date of the current year.

    date(trunc(yearval(today))+1)-1

    Gives the last date of the current year.

  • date(year, month, day)

    Creates a date value using the month, day and year components.

    Parameters

    year

    Four digit year number.

    day

    Day number starting with 1.

    month

    Month number between 1 and 12.

    Return Value

    A date value corresponding to the values year, month, day.

    Discussion

    When you enter a date value like 4/5/2016 into WKO, the date is interpreted according to the current region settings on your computer, so that could mean April 5th or May 4th. The date function eliminates that ambiguity and is interpreted the same way regardless of region settings. Dates in WKO are stored internally as days since January 1, 1901. WKO displays a date using the computer's regional settings when using the units "date" otherwise it shows a fractional number.

    Examples

    date(2016, 4, 7)

    Gives the date April 7, 2016, but the formatting depends on the units selected. In North America WKO will show 4/7/2016 if the units are date. If the units are not date then it will show the number 42,100.

    date(2015, month(today), day(today))

    Gives the date in 2015 corresponding to today's month and day.

    today - date(2015, 7, 1)

    Gives the number of days since July 1, 2015.

    date({2015:2017}, 12, 31)

    Gives a set of three dates, December 31 in the years 2015, 2016 and 2017.

  • date(year, month, day, hour, minute)

    Creates a date value using the year, month, day, hour and minute components.

    Parameters

    year

    Four digit year number.

    day

    Day number starting with 1.

    month

    Month number between 1 and 12.

    hour

    Hour number between 0 and 23.

    minute

    Minute number between 0 and 59.

    Return Value

    A date value corresponding to the values year, month, day, hour and minute

    Discussion

    This variant of the date function creates a value containing both the date and time.

    Examples

    date(2016, 4, 7)

    Gives the date April 7, 2016, but the formatting depends on the units selected. In North America WKO will show 4/7/2016 if the units are date. If the units are not date then it will show the number 42,100.

    date(2015, month(today), day(today))

    Gives the date in 2015 corresponding to today's month and day.

    today - date(2015, 7, 1)

    Gives the number of days since July 1, 2015.

    date({2015:2017}, 12, 31)

    Gives a set of three dates, December 31 in the years 2015, 2016 and 2017.

  • day(datevalues)

    Get the day of month for one or more dates.

    Parameters

    datevalues

    A single date, or set of dates.

    Return Value

    Returns the day of month (a number between 1 and 31) for datevalues.

    Examples

    day(today)

    Gives the day of month for today.

    day({today-1,today,today+1})

    Gives the day of month for yesterday, today, and tomorrow.

    Athlete Level Examples

    day(date)

    Gives the day of month for the workout date of all the workouts int the selected range.

  • dayofweek(date)

    Gives the day of week as an offset to first day of the week according to the Preferences setting.

    Parameters

    date

    One or more date values.

    Return Value

    A number between 0 and 6.

    Discussion

    The first day of the week is set in the WKO Preferences. For each date, this function gives the number of days after the first day of the week.

    Examples

    dayofweek(date(2016, 4, 7))

    If the first day of the week is configured as Monday, this gives the number 3 (Thursday).

    dayofweek(today)

    Gives the day of the week for today.

    {"Mo","Tu","We", "Th", "Fr", "Sa", "Su"}[dayofweek(date)]

    Assuming the week starts on Monday, this gives a two letter abbreviation for each workout date.

  • formatdate(datevalues, format)

    Formats date/time values using a custom format specification string. The string can contain a combination of these variables:

    yy

    Two digit year with leading zero.

    yyyy

    Four digit year

    M

    Month number without leading zero.

    MM

    Month number with leading zero

    MMM

    Abbreviated month name

    MMMM

    Full month name

    d

    Day of month wihout leading zero.

    dd

    Day of month with leading zero

    EEE

    Abbreviated day of week.

    EEEE

    Full day of week.

    h

    Hour without leading zero, 0-12

    hh

    Hour with leading zero, 00-12

    H

    Hour without leading zero, 0-24

    HH

    Hour with leading zero, 00-24

    m

    Minute without leading zero.

    mm

    Minute with leading zero.

    s

    Seconds without leading zero.

    ss

    Seconds with leading zero.

    a

    AM or PM

    You can also include other text in the format string by enclosing it in single quotes. Two single quotes in a row will be translated as one single quote. There are a few characters that do not need to be enclosed in single quotes:

    space : - . / ,

    Parameters

    datevalues

    A single date, or set of date/time values.

    format

    A format specification string.

    Return Value

    Returns a string with the formatted date/time.

    Examples

    formatdate(today, "EEEE, MMMM dd, yyyy")

    Gives todays date formatted similar to "Saturday, August 13, 2016".

    formatdate(date, "EEE MM/dd/yy hh:mm:ssa")

    Gives the date/time of a workout formatted similar to "Fri 08/12/16 01:21:06PM".

    formatdate(date, "yyyy-MM-dd HH:mm:ss")

    Gives the date/time of a workout formatted similar to "2016-08-12 13:21:06".

    formatdate(date, "h:mm 'o''clock'")

    Gives the date/time of a workout formatted similar to "1:21 o'clock".

    See Also

    date

    today

  • month(datevalues)

    Get the month number for one or more dates.

    Parameters

    datevalues

    A single date, or set of dates.

    Return Value

    Returns the month number (a number between 1 and 12) for datevalues.

    Examples

    month(date(2016,8,21))

    Gives the number 8.

    month(today)

    Gives the month number for today, a number between 1 and 12.

    Athlete Level Examples

    month(date)

    Gives the month number for the workout date of all the workouts int the selected range.

  • monthval(datevalues)

    Takes a date value and converts it to a month value.

    Parameters

    datevalues

    A single date, or set of dates.

    Return Value

    Returns the month value for datevalues.

    Discussion

    The monthval function converts the date value to a fractional number of months since January 1, 1901. This is different than the month function which only gives a number between 1 and 12. WKO displays a month value using the computer's regional settings when using the units "month" otherwise it shows a fractional number.

    Examples

    monthval(date(2015, 11, 3))

    Gives "November 2015" if the units are set to month, otherwise it gives the number 1,378.0666667.

    trunc(monthval(date(2015, 11, 3)))

    Gives "November 2015" if the units are set to month, otherwise it gives the number 1,378.

    date(trunc(monthval(today)))

    Gives the date of the first day of the current month.

    date(trunc(monthval(today))+1)

    Gives the date of the first day of the next month.

    date(trunc(monthval(today))+1)-1

    Gives the date of the last day of the current month.

  • startofmonth(datevalues)

    Get the date of first day of the month.

    Parameters

    datevalues

    A single date, or set of dates.

    Return Value

    Returns a date value for the first day of the month for each datevalue.

    Examples

    startofmonth(today)

    Gives the date of the first day of the current month.

  • startofweek(datevalues)

    Get the month number for one or more dates.

    Parameters

    datevalues

    A single date, or set of dates.

    Return Value

    Returns the date of the first day of the week for each date in datevalues.

    Discussion

    This could be useful when creating a date range in the RHE.

    Examples

    startofweek(today)

    Gives the date of the first day in the current week.

    startofweek(today) + 6

    Gives the date of the last day in the current week.

    startofweek(today) + 7

    Gives the date of the first day in the next week.

  • startofyear(datevalues)

    Get the date of the start of the year that contains datevalues.

    Parameters

    datevalues

    A single date, or set of dates.

    Return Value

    Returns January 1st of the year specified in datevalues.

    Discussion

    This could be useful when creating a date range in the RHE.

    Examples

    startofyear(today)

    Gives the first day of the current year.

    date(year(today), 12, 31)

    Gives the last date of the current year.

    startofyear(startofyear(today)-1)

    date(year(today)-1, 1, 1)

    Both give the first day of the previous year.

    startofyear(today)-1

    Gives the last day of the previous year.

  • week(datevalues)

    Get the week number for one or more dates.

    Parameters

    datevalues

    A single date, or set of dates.

    Return Value

    Returns the week number (a number between 1 and 53) for datevalues.

    Discussion

    This function gives a number according to the ISO-8601 standard. It is a count of weeks starting on Monday, where the first week of the year is the week that contains that year's first Thursday (a minimum of four days in the first week).

    Examples

    week(today)

    Gives the week number for today, a number between 1 and 53.

    Athlete Level Examples

    month(date)

    Gives the month number for the workout date of all the workouts int the selected range.

  • weekval(datevalues)

    Takes a date value and converts it to a week value.

    Parameters

    datevalues

    A single date, or set of dates.

    Return Value

    Returns the week value for datevalues.

    Discussion

    The weekval function converts the date value to a fractional number of weeks since January 1, 1901. Whereas the week function gives a number between 1 and 53, the weekval function gives a month for a specific date to include the year, and then formats the number as "month yyyy" such as "March 2015".

    Examples

    weekval(date(2015, 11, 8))

    Gives "11/8/15" if the units are set to week, otherwise if the units are blank it gives the number 5,993.857.

    trunc(weekval(date(2015, 11, 8)))

    Gives "11/2/15" (a Monday) if the units are set to week, otherwise if the units are blank it gives the number 5,993. The trunc function removes the fractional part of the week.

  • year(datevalues)

    Get the year number for one or more dates.

    Parameters

    datevalues

    A single date, or set of dates.

    Return Value

    Returns the year number, a four digit number like 2016.

    Examples

    year(date(2017,8,21))

    Gives the number 2017.

    year(today)

    Gives the four digit year number for today.

    Athlete Level Examples

    year(date)

    Gives the year number for the workout date of all the workouts int the selected range.

  • yearval(datevalues)

    Takes a date value and converts it to a year value.

    Parameters

    datevalues

    A single date, or set of dates.

    Return Value

    Returns the year value for datevalues.

    Discussion

    The yearval function converts the date value to a fractional number of years since January 1, 1901. Whereas the year function gives a number between 1980 and 2099, the yearval function gives a the fractional number of years since January 1, 1901.

    Examples

    yearval(date(2015, 11, 8))

    Gives 2015 if the units are set to year, otherwise if the units are blank it gives the number 114.852.

    trunc(yearval(date(2015, 11, 8)))

    Gives 2015 if the units are set to year, otherwise if the units are blank it gives the number 114. The trunc function removes the fractional part of the year.

Logical

  • logicaland(lhs, rhs)

    Evaluates a logical and, same as the and and && operators.

    Parameters

    lhs

    Left hand side operand.

    rhs

    Right hand side operand.

    Return Value

    Returns 1 if both lhs and rhs are nonzero, otherwise returns 0.

    Discussion

    The and and && operators both use the logicaland function. So that means that both date>today and plannedtss>100 and date>today && plannedtss>100 are equivalent to logicaland(date>today, plannedtss>100). The logicaland function and equivalent operators are most often used with the if function to create a compound condition, for example "if this and that".

    Athlete Level Examples

    if(logicaland(date>today, plannedtss>100), plannedtss)

    Gives the planned TSS for all workouts after today and have planned TSS greater than 100.

  • logicalor(lhs, rhs)

    Evaluates a logical or, same as the or and || operators.

    Parameters

    lhs

    Left hand side operand.

    rhs

    Right hand side operand.

    Return Value

    Returns 1 if either lhs or rhs are nonzero, otherwise returns 0.

    Discussion

    The or and || operators both use the logicalor function. So that means that both hastag("race") or has(title, "race") and hastag("race") || has(title, "race") are equivalent to logicalor(hastag("race"), has(title, "race")). The logicalor function and equivalent operators are most often used with the if function to create a compound condition, for example "if this or that".

    Athlete Level Examples

    if(logicalor(hastag("race"), has(title, "race")), if)

    Gives the intensity factor for all workouts that either have a tag named race or have race somewhere in the workout title.

Mathematical

  • abs(numbers)

    Calculates the absolute value of each number value in numbers.

    Parameters

    numbers

    A single number, a set of numbers, or a numeric variable.

    Return Value

    The absolute value of each value in numbers.

    Examples

    abs(3)

    3

    abs(-3)

    3

    abs({1,-1,0,3,-3})

    {1, 1, 0, 3, 3}

    abs(elevation)

    The absolute value of every value in elevation.

    See Also

    sign(numbers)

  • add(lhs, rhs)

    Adds lhs to rhs.

    Parameters

    lhs

    A single number, a set of numbers, or a numeric variable.

    rhs

    A single number, a set of numbers, or a numeric variable.

    Return Value

    The sum of rhs and lhs.

    Examples

    add(1,2)

    3

    add(1,-3)

    • 2

    add({1,2,3}, {4,5,6})

    {5, 7, 9}

    See Also

    +

  • divide(lhs, rhs)

    Divides lhs by rhs.

    Parameters

    lhs

    A single number, a set of numbers, or a numeric variable.

    rhs

    A single number, a set of numbers, or a numeric variable.

    Return Value

    The result of lhs divided by rhs.

    Examples

    divide(1,2)

    0.5

    divide(1,-4)

    • 0.25

    divide({2,10,50}, {2,2,5})

    {1, 5, 10}

    See Also

    /

  • ln(numbers)

    Gives the natural log of numbers.

    Parameters

    numbers

    A single number, a set of numbers, or a numeric variable.

    Return Value

    The natural log of numbers.

    Examples

    ln(e^5)

    5

  • log(numbers, base)

    Gives the base base logarithm of numbers.

    Parameters

    numbers

    A single number, a set of numbers, or a numeric variable.

    base

    The base of the logarithm.

    Return Value

    The log of numbers.

    Examples

    log(64,2)

    Gives the number 6, because 2^6 = 64.

  • log10(numbers)

    Gives the base 10 logarithm of numbers.

    Parameters

    numbers

    A single number, a set of numbers, or a numeric variable.

    Return Value

    The log of numbers.

    Examples

    log10(1000)

    Gives the number 3, because 10^3 = 1000.

  • multiply(lhs, rhs)

    Multiply lhs by rhs.

    Parameters

    lhs

    A single number, a set of numbers, or a numeric variable.

    rhs

    A single number, a set of numbers, or a numeric variable.

    Return Value

    The product of lhs multiplied by rhs.

    Examples

    multiply(1,2)

    2

    multiply({2,10,50}, {2,2,5})

    {4, 20, 250}

    See Also

    *

  • power(lhs, rhs)

    Raise lhs to the power rhs.

    Parameters

    lhs

    A single number, a set of numbers, or a numeric variable.

    rhs

    A single number, a set of numbers, or a numeric variable.

    Return Value

    The value of lhs raised to the rhs power.

    Examples

    power(2,4)

    16

    power(64,1/3)

    4 64^(1/2)

    power({2,10,50}, {5,3,2})

    {32, 1000, 2500}

    See Also

    ^

  • sign(numbers)

    Gives the sign of numbers.

    Parameters

    numbers

    A single number, a set of numbers, or a numeric variable.

    Return Value

    Returns 1 for positive numbers, -1 for negative numbers and 0 for zero.

    Examples

    sign(3)

    1

    sign(-9)

    (-1)

    sign(0)

    0

    sign({-7,5,11})*abs({-7,5,11})

    {-7,5,11}

  • sqrt(numbers)

    Gives the square root of numbers.

    Parameters

    numbers

    A single number, a set of numbers, or a numeric variable.

    Return Value

    The square root of numbers.

    Examples

    sqrt(16)

    4

    sqrt({9,64,16})

    {3, 8, 4}

  • subtract(lhs, rhs)

    Subtracts rhs from lhs.

    Parameters

    lhs

    A single number, a set of numbers, or a numeric variable.

    rhs

    A single number, a set of numbers, or a numeric variable.

    Return Value

    The difference of lhs minus rhs.

    Examples

    subtract(1,2)

    Gives -1.

    subtract(1,-3)

    Gives 4.

    subtract({7,2,19}, {4,5,6})

    Gives {3, -3, 13}.

    See Also

    -

Power-Duration

  • fibertype(meanmaxcurve)

    Get the estimated % type I muscle fiber area (slow-twitch) based on a mean maximal curve.

    Parameters

    meanmaxcurve

    Mean maximal power curve data, usually meanmax(power).

    Return Value

    The estimated % type I muscle fiber area.

    Discussion

    This function gives the percent of type I fast twitch musle fiber for the time period included in meanmaxcurve. It gives a single number for a meanmax curve, where the quality of the estimate is increased by including a representative sample of workouts in that meanmaxcurve. Read the Power-Duration Metrics e-book.

    Examples

    fibertype(meanmax(power))

    Gives the percent of type I slow-twitch muscle fiber for the meanmax curve.

  • fibertype(meanmaxcurve, lookback)

    Get daily estimated % type I muscle fiber area (slow-twitch) based on a rolling window of lookback days.

    Parameters

    meanmaxcurve

    Mean maximal power curve data, usually meanmax(power).

    lookback

    The number of backward looking days.

    Return Value

    Daily estimated % percentages of type I slow-twitch muscle fiber, based on a rolling window of lookback days.

    Discussion

    This function builds a meanmax curve for every date in the selected RHE date range, where each meanmax curve is comprised of the previous lookback days. Then from each daily meanmax curve it calculates the percentage of type II fibers. Typical numbers to use for lookback are between 30 and 90; larger numbers are chosen to capture bests at the largest variety of durations, but smaller numbers are used to be more sensitive to detraining. Read the Power-Duration Metrics e-book.

    Examples

    fibertype(meanmax(power),90)

    Gives daily estimated % of type I slow-twitch fibers.

  • frc(meanmaxcurve)

    Get the Functional Reserve Capacity.

    Parameters

    meanmaxcurve

    Mean maximal power curve data, usually meanmax(power) or meanmax(power/weight).

    Return Value

    The Functional Reserve Capacity value in kJ or kJ/kg for meanmaxcurve.

    Discussion

    This function gives the Functional Reserve Capacity for the time period included in the meanmaxcurve. It gives a single number for a meanmax curve, where the quality of the estimate is increased by including a representative sample of workouts in that meanmaxcurve. Read the Power-Duration Metrics e-book.

    Examples

    frc(meanmax(power))

    Gives the Functional Reserve Capacity in kJ.

    frc(meanmax(power/weight))

    Gives the Functional Reserve Capacity normalized to weight in kJ/kg.

  • frc(meanmaxcurve, lookback)

    Get daily the Functional Reserve Capacity based on a rolling window of lookback days.

    Parameters

    meanmaxcurve

    Mean maximal power curve data, usually meanmax(power).

    lookback

    The number of backward looking days.

    Return Value

    Gives daily Functional Reserve Capacity values, one for each date in the selected RHE date range.

    Discussion

    This function builds a meanmax curve for every date in the selected RHE date range, where each meanmax curve is comprised of the previous lookback days. Then from each daily meanmax curve it calculates the FRC. Typical numbers to use for lookback are between 30 and 90; larger numbers are chosen to capture bests at the largest variety of durations, but smaller numbers are used to be more sensitive to detraining. Read the Power-Duration Metrics e-book.

    Examples

    frc(meanmax(power/weight),90)

    Gives daily FRC normalized for body weight in mL/min/kg.

  • frccurve(meanmaxcurve)

    Generate a power-duration curve based on meanmaxcurve showing only the FRC component.

    Parameters

    meanmaxcurve

    Mean maximal power curve data, usually meanmax(power) or meanmax(power/weight).

    Return Value

    A power-duration curve showing modeled power derived from FRC, at a variety of durations.

    Discussion

    Read the Power-Duration Metrics e-book.

    Examples

    pdcurve(meanmax(power))

    Gives a power-duration curve.

  • frce(meanmaxcurve)

    Get the estimated error calculating Functional Reserve Capacity.

    Parameters

    meanmaxcurve

    Mean maximal power curve data, usually meanmax(power) or meanmax(power/weight.

    Return Value

    Estimated error as +/- kJ orkJ/kg.

    Discussion

    This function calculates the estimated error when modeling FRC, in +/- kJ or kJ/kg. Read the Power-Duration Metrics e-book.

    Examples

    frce(meanmax(power))

    Gives the estimated error as +/- kJ.

  • ftp(meanmaxcurve)

    Get the modeled Functional Threshold Power.

    Parameters

    meanmaxcurve

    Mean maximal power curve data, usually meanmax(power) or meanmax(power/weight).

    Return Value

    The Functional Threshold Power value in W or W/kgfor meanmaxcurve.

    Discussion

    This function gives the Functional Threshold Power for the time period included in the meanmaxcurve. It gives a single number for a meanmax curve, where the quality of the estimate is increased by including a representative sample of workouts in that meanmaxcurve. Read the Power-Duration Metrics e-book.

    Examples

    ftp(meanmax(power))

    Gives modeled FTP in W.

    ftp(meanmax(power/weight))

    Gives modeled FTP normalized for body weight in W/kg.

  • ftp(meanmaxcurve, lookback)

    Get daily modeled FTP.

    Parameters

    meanmaxcurve

    Mean maximal power curve data, usually meanmax(power).

    lookback

    The number of backward looking days.

    Return Value

    Gives daily Functional Threhold Power values, one for each date in the selected RHE date range.

    Discussion

    This function builds a meanmax curve for every date in the selected RHE date range, where each meanmax curve is comprised of the previous lookback days. Then from each daily meanmax curve it calculates the FTP. Typical numbers to use for lookback are between 30 and 90; larger numbers are chosen to capture bests at the largest variety of durations, but smaller numbers are used to be more sensitive to detraining. Read the Power-Duration Metrics e-book.

    Examples

    ftp(meanmax(power),90)

    Gives daily modeled FTP.

  • ftpcurve(meanmaxcurve)

    Generate a power-duration curve based on meanmaxcurve showing only the FTP component.

    Parameters

    meanmaxcurve

    Mean maximal power curve data, usually meanmax(power) or meanmax(power/weight).

    Return Value

    A power-duration curve showing modeled power derived from FTP, at a variety of durations.

    Discussion

    Read the Power-Duration Metrics e-book.

    Examples

    pdcurve(meanmax(power))

    Gives a power-duration curve.

  • ftpe(meanmaxcurve)

    Get the estimated error calculating Functional Threshold Power.

    Parameters

    meanmaxcurve

    Mean maximal power curve data, usually meanmax(power).

    Return Value

    One daily modeled FTP number for each date in the selected RHE date range.

    Discussion

    This function builds a meanmax curve for every date in the selected RHE date range, where each meanmax curve is comprised of the previous lookback days. Then from each daily meanmax curve it calculates the vo2max. Typical numbers to use for lookback are between 30 and 90; larger numbers are chosen to capture bests at the largest variety of durations, but smaller numbers are used to be more sensitive to detraining. Read the Power-Duration Metrics e-book.

    Examples

    vo2max(meanmax(power),90)*1000/metric(weight)"mL/min/kg"

    Gives daily FTP normalized for body weight in mL/min/kg.

  • pdcurve(meanmaxcurve)

    Generate a power-duration curve based on meanmaxcurve.

    Parameters

    meanmaxcurve

    Mean maximal power curve data, usually meanmax(power).

    Return Value

    A power-duration curve showing modeled power at a variety of durations.

    Discussion

    Read the Power-Duration Metrics e-book.

    Examples

    pdcurve(meanmax(power))

    Gives a power-duration curve.

  • pdcurve(standardindex, gender)

    Generate a power-duration curve in power/weight based based on standards for the specified gender.

    Parameters

    standardindex

    A number from 0 through 7, or one of the following: "untrained", "fair", "moderate", "good",

    "verygood", "excellent", "exceptional", "worldclass".

    gender

    Either "male" or "female".

    Return Value

    A power-duration curve showing modeled power for different standards.

    Discussion

    Read the Power-Duration Metrics e-book.

    Examples

    pdcurve("excellent", "female")

    Gives a power-duration curve standard line for "excellent" females.

  • pdprofile(meanmaxcurve)

    Generate a power-duration profile curve.

    Parameters

    standardindex

    A number from 0 through 7, or one of the following: "untrained", "fair", "moderate", "good",

    "verygood", "excellent", "exceptional", "worldclass".

    gender

    Either "male" or "female".

    Return Value

    A power-duration curve showing modeled power for different standards.

    Examples

    pdprofile(meanmax(power/weight))

    Gives a power-duration curve for "excellent" females.

  • phenotype(meanmaxcurve)

    Get rider phenotype based on meanmaxcurve.

    Parameters

    meanmaxcurve

    Mean maximal power curve data, usually meanmax(power).

    Return Value

    The phenotype of the athlete: "Sprinter", "Pursuiter", "TTer", or "All-rounder".

    Discussion

    This function builds a meanmax curve for every date in the selected RHE date range, where each meanmax curve is comprised of the previous lookback days. Then from each daily meanmax curve it calculates the vo2max. Typical numbers to use for lookback are between 30 and 90; larger numbers are chosen to capture bests at the largest variety of durations, but smaller numbers are used to be more sensitive to detraining. Read the Power-Duration Metrics e-book.

    Examples

    vo2max(meanmax(power),90)*1000/metric(weight)"mL/min/kg"

    Gives daily VO2max normalized for body weight in mL/min/kg.

  • pmax(meanmaxcurve)

    Get Pmax in W or W/kg.

    Parameters

    meanmaxcurve

    Mean maximal power curve data, usually meanmax(power) or meanmax(power/weight).

    Return Value

    The athlete's Pmax for the selected RHE date range.

    Discussion

    Gives the modeled maximum power. Read the Power-Duration Metrics e-book.

    Examples

    pmax(meanmax(power))

    Gives the Pmax for the selected date range.

  • pmax(meanmaxcurve, lookback)

    Get daily Pmax in W or W/kg.

    Parameters

    meanmaxcurve

    Mean maximal power curve data, usually meanmax(power) or meanmax(power/weight).

    lookback

    The number of backward looking days to include when calculating each daily Pmax.

    Return Value

    One daily Pmax number for each date in the selected RHE date range.

    Discussion

    This function builds a meanmax curve for every date in the selected RHE date range, where each meanmax curve is comprised of the previous lookback days. Then from each daily meanmax curve it calculates the Pmax. Typical numbers to use for lookback are between 30 and 90; larger numbers are chosen to capture bests at the largest variety of durations, but smaller numbers are used to be more sensitive to detraining. Read the Power-Duration Metrics e-book.

    Examples

    pmax(meanmax(power))

    Gives daily Pmax.

  • pmaxe(meanmaxcurve)

    Get the estimated error calculating Pmax.

    Parameters

    meanmaxcurve

    Mean maximal power curve data, usually meanmax(power).

    Return Value

    The estimated error for Pmax in the selected RHE date range.

    Discussion

    This function calculates the esimated error in Pmax for the date range in +/- W. Read the Power-Duration Metrics e-book.

    Examples

    pmaxe(meanmax(power))

    Gives the estimated error calculating Pmax in +/- W.

  • sumsqr(meanmaxcurve)

    Gives the sum of squares error fitting meanmaxcurve to the power-duration model.

    Parameters

    meanmaxcurve

    Mean maximal power curve data, usually meanmax(power) or meanmax(power/weight).

    Return Value

    The sum of squares error, where a lower number indicates a better fit.

    Examples

    pmax(meanmax(power))

    Gives the sum of squares error for the selected date range.

  • tte(meanmaxcurve)

    Get Time to Exhaustion in seconds.

    Parameters

    meanmaxcurve

    Mean maximal power curve data, usually meanmax(power).

    Return Value

    The athlete's Time to Exhaustion for the selected RHE date range.

    Discussion

    Gives the modeled Time to Exhaustion. Read the Power-Duration Metrics e-book.

    Examples

    pmax(meanmax(power))

    Gives the TTE for the selected date range.

  • tte(meanmaxcurve, lookback)

    Get daily Time to Exhaustion in seconds.

    Parameters

    meanmaxcurve

    Mean maximal power curve data, usually meanmax(power) or meanmax(power/weight).

    lookback

    The number of backward looking days to include when calculating each daily Pmax.

    Return Value

    One daily TTE number for each date in the selected RHE date range.

    Discussion

    This function builds a meanmax curve for every date in the selected RHE date range, where each meanmax curve is comprised of the previous lookback days. Then from each daily meanmax curve it calculates the Pmax. Typical numbers to use for lookback are between 30 and 90; larger numbers are chosen to capture bests at the largest variety of durations, but smaller numbers are used to be more sensitive to detraining. Read the Power-Duration Metrics e-book.

    Examples

    pmax(meanmax(power))

    Gives daily Pmax.

  • vo2max(meanmaxcurve)

    Get VO2max in L/min.

    Parameters

    meanmaxcurve

    Mean maximal power curve data, usually meanmax(power).

    Return Value

    The athlete's VO2max for the selected RHE date range.

    Discussion

    Gives the estimated VO2max for the selected date range.Read the Power-Duration Metrics e-book.

    Examples

    vo2max(meanmax(power))*1000/metric(weight)"mL/min/kg"

    Gives VO2max normalized for body weight in mL/min/kg.

  • vo2max(meanmaxcurve, lookback)

    Get daily VO2max in L/min.

    Parameters

    meanmaxcurve

    Mean maximal power curve data, usually meanmax(power).

    lookback

    The number of backward looking days to include when calculating each daily vo2max.

    Return Value

    One daily VO2max number for each date in the selected RHE date range.

    Discussion

    This function builds a meanmax curve for every date in the selected RHE date range, where each meanmax curve is comprised of the previous lookback days. Then from each daily meanmax curve it calculates the vo2max. Typical numbers to use for lookback are between 30 and 90; larger numbers are chosen to capture bests at the largest variety of durations, but smaller numbers are used to be more sensitive to detraining. Read the Power-Duration Metrics e-book.

    Examples

    vo2max(meanmax(power),90)*1000/metric(weight)"mL/min/kg"

    Gives daily VO2max normalized for body weight in mL/min/kg.

Rounding

  • ceil(numbers)

    Calculate the ceiling of each value in numbers.

    Parameters

    numbers

    A single number, a set of numbers, or a numeric variable.

    Return Value

    The smallest integer greater than or equal to each value in numbers.

    Examples

    ceil(3)

    3

    ceil(3.1)

    4

    ceil({-3.3,0,-7.8, 5.9})

    {-3,0,-7,6}

  • floor(numbers)

    Calculate the floor of each value in numbers.

    Parameters

    numbers

    A single number, a set of numbers, or a numeric variable.

    Return Value

    The largest integer less than or equal to each value in numbers.

    Examples

    floor(3)

    3

    floor(3.1)

    3

    floor({-3.3,0,-7.8, 5.9})

    {-4,0,-8,5}

  • frac(numbers)

    Get the fractional part of each value in numbers.

    Parameters

    numbers

    A single number, a set of numbers, or a numeric variable.

    Return Value

    The fractional part of a number with the integer portion removed.

    Examples

    frac(3)

    0

    frac(3.1)

    0.1

    frac({-3.3,0,-7.8, 5.9})

    {-0.3, 0, -0.8, 0.9}

    See Also

    round(numbers)

  • round(numbers)

    Round each value in numbers to the nearest integer.

    Parameters

    numbers

    A single number, a set of numbers, or a numeric variable.

    Return Value

    The numbers rounded to the nearest integer.

    Examples

    round(3.1)

    3

    round(3.5)

    4

    round({-3.3,0,-7.8, 5.9})

    {-3, 0, -8, 6}

  • round(numbers, places)

    Round each value in numbers to the specified number of places.

    Parameters

    numbers

    A single number, a set of numbers, or a numeric variable.

    places

    Position to round, where negative is to the right of the decimal point.

    Return Value

    The numbers rounded to the specified number of places.

    Examples

    round(pi,-1)

    3.1

    round(pi,-3)

    3.142

    round(1234.567,2)

    1200

    See Also

    round(numbers)

  • trunc(numbers)

    Truncate each value in numbers.

    Parameters

    numbers

    A single number, a set of numbers, or a numeric variable.

    Return Value

    The integral part of a number with any fractional digits removed

    Examples

    trunc(3)

    3

    trunc(3.1)

    3

    trunc({-3.3,0,-7.8, 5.9})

    {-3,0,-7,5}

Selection

  • athleterange(fromdate, todate, expression)

    Evaluates expression using the date range given by fromdate through todate overriding the date selection in the RHE.

    Parameters

    fromdate

    Starting date of the date range.

    todate

    Ending date of the date range.

    expression

    The expression to evaluate.

    Return Value

    The result of expression.

    Discussion

    At the athlete level, the athleterange function allows you to override the date range in the RHE. At the workout level you can use athleterange to evaluate athlete level expressions. When you use athleterange at the athlete level, it will filter workouts based on the sport type buttons at the top of the Right Hand Explorer. When you use athleterange at the workout level, there are no sport type buttons at the top of the Right Hand Explorer so it will use all sport types.

    Examples

    athleterange(date(2017,2,23), date(2017,3,17), avg(tss))

    The average TSS for the explicit date range, regardless of what's selected in the RHE.

    athleterange(today - 30, today, sum(distance))

    The total distance in the last 30 days.

    athleterange(date-89, date, ftp(meanmax(power)))

    At the workout level, gives the mFTP as of the current workout. At the athlete level, gives mFTP numbers as of each workouts in the current range.

  • clamp(values, min, max)

    Returns values such that values less than min are changed to min, and values greater than max are changed to max.

    Parameters

    values

    A single number, a set of numbers or strings, or a variable.

    min

    The minimum value allowed.

    max

    The maximum value allowed.

    Return Value

    Everything in values changed so that any numbers < min are changed to min, and any numbers > max are changed to max.

    Examples

    clamp({5,7,3,2,4,9,8}, 4, 8)

    {5,7,4,4,4,8,8}

  • first(values, count)

    Returns the first count values in values.

    Parameters

    values

    A single number, a set of numbers or strings, or a variable.

    count

    The count of values to return.

    Return Value

    The count first values in values.

    Discussion

    The first function returns (X,Y) pairs if values contains (X,Y) pairs. When you graph an (X,Y) pair on a chart you get a single point, therefore you get a point for each of the first values found. If you include an (X,Y) pair in a report you'll see the value for X in the leftmost column.

    Examples

    first({5,7,3,2,4,9,8}, 3)

    {5, 7, 3}

    first({"Yankee","Bravo","Zulu","Alpha","Foxtrot"},3)

    {"Yankee", "Bravo", "Zulu"}

  • greatest(values, count)

    Returns the greatest count values in values.

    Parameters

    values

    A single number, a set of numbers or strings, or a variable.

    count

    The count of values to return.

    Return Value

    The count greatest values in values.

    Discussion

    The greatest function returns (X,Y) pairs if values contains (X,Y) pairs. When you graph an (X,Y) pair on a chart you get a single point, therefore you get a point for each of the greatest values found. If you include an (X,Y) pair in a report you'll see the value for X in the leftmost column.

    Examples

    greatest({5,7,3,2,4,9,8}, 3)

    {7, 9, 8}

    sortd(greatest(tss,5))

    Gives the 5 greatest TSS numbers sorted from greatest to least, along with the date of each TSS value.

    metric(60/greatest(meanmax((metric(elapseddistance),runspeed), 5.0), 3))

    Gives the 3 fastest 5K run pace in min/km, along with the date of each.

  • last(values, count)

    Returns the last count values in values.

    Parameters

    values

    A single number, a set of numbers or strings, or a variable.

    count

    The count of values to return.

    Return Value

    The count last values in values.

    Discussion

    The last function returns (X,Y) pairs if values contains (X,Y) pairs. When you graph an (X,Y) pair on a chart you get a single point, therefore you get a point for each of the last values found. If you include an (X,Y) pair in a report you'll see the value for X in the leftmost column.

    Examples

    first({5,7,3,2,4,9,8}, 3)

    {4, 9, 8}

  • least(values, count)

    Returns the least count values in values.

    Parameters

    values

    A single number, a set of numbers or strings, or a variable.

    count

    The count of values to return.

    Return Value

    The count least values in values.

    Discussion

    The least function returns (X,Y) pairs if values contains (X,Y) pairs. When you graph an (X,Y) pair on a chart you get a single point, therefore you get a point for each of the least values found. If you include an (X,Y) pair in a report you'll see the value for X in the leftmost column.

    Examples

    least({5,7,3,2,4,9,8}, 3)

    {3, 2, 4}

  • max(values)

    Returns the greatest values in values.

    Parameters

    values

    A single number, a set of numbers or strings, or a variable.

    Return Value

    The greatest values in values.

    Discussion

    The max function returns ( ,Y) with no X value. When you graph ( ,Y) on a chart you'll get a horizontal line.

    Examples

    max({5,7,3,2,4,9,8})

    9

    max(tss)

    Gives the maximum TSS number as a horizontal line.

    max(power)

    Gives the maximum power number as a horizontal line.

  • max(values, groupby)

    Returns the maximum values in values grouped by groupby.

    Parameters

    values

    A single number, a set of numbers or strings, or a variable.

    groupby

    A grouping identifier for each value in values.

    Return Value

    The greatest values in values for each unique value in groupby.

    Discussion

    The max function will first organize values into groups where each value in groupby represents a group. Then it finds the maximum value in each group.

    Examples

    max(distance, dayofweek(date))

    The maximum distance for each day of the week.

    See Also

    max(values)

  • min(values)

    Returns the least value in values.

    Parameters

    values

    A single number, a set of numbers or strings, or a variable.

    Return Value

    The least value in values.

    Discussion

    The min function returns ( ,Y) with no X value. When you graph ( ,Y) on a chart you'll get a horizontal line.

    Examples

    min({5,7,3,2,4,9,8})

    2

    min(heartrate)

    Gives the minimum heart rate number as a horizontal line.

  • min(values, groupby)

    Returns the minimum values in values grouped by groupby.

    Parameters

    values

    A single number, a set of numbers or strings, or a variable.

    groupby

    A grouping identifier for each value in values.

    Return Value

    The minimum values in values for each unique value in groupby.

    Discussion

    The min function will first organize values into groups where each value in groupby represents a group. Then it finds the minimum value in each group.

    Examples

    min(distance, dayofweek(date))

    The minimum distance for each day of the week.

    See Also

    min(values)

  • workoutrange(fromtime, totime, expression)

    Evaluates expression using the time range given by fromtime through totime overriding the time selection in the RHE.

    Parameters

    fromtime

    Starting time of the date range.

    totime

    Ending time of the date range.

    expression

    The expression to evaluate.

    Return Value

    The result of expression.

    Discussion

    The workoutrange function allows you to override the date range in the RHE.

    Examples

    workoutrange(begintime+duration/2,endtime,avg(power))

    Average power for second half of the range selected in the RHE.

Smoothing

Sorting and Reshaping

  • cross(values, values)

    No longer used. You can use cartesian coordinate notation (X, Y) instead.

  • delta(numbers)

    Gives the difference between each each number minus the previous number.

    Parameters

    numbers

    A list of numbers.

    Return Value

    A list of numbers.

    Examples

    delta({3,5,7,11,13})

    Gives the list {na,2,2,4,2}.

    sum(delta(frontgear>0))

    Gives the count of front gear changes.

  • noinvalid(numbers)

    Removes all occurrences of na in numbers.

    Parameters

    numbers

    A set of zero or more numbers.

    Return Value

    Returns numbers with na removed.

    Examples

    noinvalid({13,0,7,na,0,21})

    Returns {13,0,7,0,21}

    See Also

    nozero(numbers)

  • nozero(numbers)

    Changes all occurrences of 0 in numbers to na.

    Parameters

    numbers

    A set of zero or more numbers.

    Return Value

    Returns numbers with zeros changed to na.

    Examples

    nozero({13,0,7,na,0,21})

    Returns {13,na,7,na,na,21}

    avg(nozero(cadence)))

    Gives average cadence not including zeros.

  • resample(values, newrate)

    Resamples time series data.

  • rev(values)

    Reverses the order of values.

    Parameters

    values

    A set of zero or more values.

    Return Value

    Returns values in reverse order.

    Examples

    rev({3,5,7,9})

    Reverses {3,5,7,9} to be come {9,7,5,3}.

  • shift(numbers, positions)
  • sort(values)

    Sorts a list of values in ascending order.

    Parameters

    values

    A set of zero or more values.

    Return Value

    Returns sorted values.

    Examples

    sort({5,3,8,0,na,7,6,2,4,1})

    Gives {0,1,2,3,4,5,6,7,8,--}.

    sort((power,cadence))

    Sorts the scatter graph of (power,cadence) in ascending order by cadence.

  • sortd(values)

    Sorts a list of values in descending order.

    Parameters

    values

    A set of zero or more values.

    Return Value

    Returns sorted values.

    Examples

    sortd(greatest(tss,5))

    Gives the 5 greatest TSS numbers sorted from greatest to least.

  • sortx(pairs)

    Sorts a list of pairs in ascending order of X.

    Parameters

    pairs

    A set of zero or more pairs.

    Return Value

    Returns sorted pairs.

    Examples

    sortx((power,cadence))

    Sorts the scatter graph of (power,cadence) in ascending order by power.

  • sortxd(pairs)

    Sorts a list of pairs in descending order of X.

    Parameters

    pairs

    A set of zero or more pairs.

    Return Value

    Returns sorted values.

    Examples

    sortxd(greatest(tss,5))

    Gives the 5 greatest TSS numbers sorted from greatest to least.

  • string(values)

    Converts number values to string values.

    Parameters

    values

    A list of numbers.

    Return Value

    A list of strings.

    Discussion

    If you use the + operator to add numbers you get the result of adding the two, such as adding 2 + 3 you get 5. If you want to concatenate two or more values, then you need to convert them to strings first. For example, if you want to take 39 + 23 and get 3923 you first need to convert 39 and 23 to strings.

    Examples

    sort(unique(string(frontgear)+"x"+string(reargear)))

    Lists all the gear combinations (in the format 39x23) used in the currently selected workout or workout range, assuming the workout has frontgear and reargear shifting channels in it.

  • unique(values)

    Gives only the unique values from a list.

    Parameters

    values

    A list of strings or numbers.

    Return Value

    A list of values with duplicates removed.

    Examples

    sort(unique(tags))

    Lists all the tags used in the currently selected workout or workout range.

    See Also

    sort(values)

  • xx(pairs)

    Takes a set of (X,Y) values and copies X to Y to become (X,X).

    Parameters

    pairs

    A set of X,Y pairs.

    Return Value

    Returns (X,Y) pairs as (X,X).

    Examples

    xx((37,52))

    Takes the point (37,52) and changes it to (37,37).

    meanmax((power)*xx((meanmax((power))/1000

    Gives work expended at each point on a mean maximal power curve, where kJ = watts * seconds / 1000.

    See Also

    yx(pairs)

  • yx(pairs)

    Takes a set of X,Y vales and exchanges X and Y to be come Y,X.

    Parameters

    pairs

    A set of X,Y pairs.

    Return Value

    Returns (X,Y) pairs as (Y,X).

    Examples

    yx((37,52))

    Takes the point (37,52) and changes it to (52,37).

    yx(meanmax(power))

    Gives mean maximal power with power on the X axis and duration on the Y axis.

    See Also

    xx(pairs)

Statistical

  • avg(numbers)

    Calculates the average of the numbers in numbers by taking their sum and dividing by their count.

    Parameters

    numbers

    A single number, a set of numbers, or a numeric variable.

    Return Value

    The average of the values in numbers.

    Examples

    avg({3, 6, 9, 12})

    10

    avg(power)

    The average of each value in power. In other words, average power.

  • avg(numbers, groupby)

    Returns the average of values grouped by groupby.

    Parameters

    numbers

    A single number, a set of numbers or strings, or a variable.

    groupby

    A grouping identifier for each value in numbers.

    Return Value

    The average of numbers for each unique value in groupby.

    Discussion

    The avg function will first organize numbers into groups where each value in groupby represents a group. Then it finds the average value of each group.

    Examples

    avg(distance, dayofweek(date))

    The average distance for each day of the week.

    See Also

    avg(numbers)

  • bin(values, binsize)

    Creates a histogram by placing values into specified bins and accumulating duration for each value.

    Parameters

    values

    The values to place into bins.

    binsize

    The size of all bins.

    Return Value

    A set of values representing the duration in each bin.

    Discussion

    Each bin is uniform in size as specified.

    Examples

    bin(cadence, 10)

    Places cadence in bins of 10 rpm each.

  • bin(values, binvalues)

    Creates a histogram by placing values into specified bins and accumulating duration for each value.

    Parameters

    values

    The values to place into bins.

    binvalues

    A set of values representing cut points for the bins.

    Return Value

    A set of values representing the duration in each bin.

    Discussion

    Each bin contains the durations for values up to but not equal the value specified. There will be one bin for each value in binvalues plus one bin. For example, if binvalues is {100, 200, 300} then values will be placed into 4 bins as follows: less than 100, 100 to less than 200, 200 to less than 300, and 300 up.

    Examples

    bin(cadence, {85,95})

    Creates 3 cadence bins: below 85, 85 up to 95, and 95 and above.

    bin(power, {162, 184, 206, 228})

    Bins power using a set of wattage numbers.

    bin(power, {0.81, 0.92, 1.03, 1.14} * runftp)

    Bins power using a set of percentages of Run FTP.

    sum(bin(heartrate, {0.82/3, 0.82*2/3, 0.82, (0.82+0.89)/2, 0.89, 0.94, 1.00, 1.03, 1.06} * bikethr) / 3600 * {20, 30, 40, 50, 60, 70, 80, 100, 120, 140})"hrTSS"

    Calculates hrTSS using Friel bike heart rate levels.

  • bin(values, levelsname)

    Creates a histogram by placing values into specified bins and accumulating duration for each value.

    Parameters

    values

    The values to place into bins.

    levelsname

    The name of a training levels system.

    Return Value

    A set of values representing the duration in each bin.

    Discussion

    The bins are determined by training levels. When deciding into which level a value should be placed, WKO5 checks to see if the value is >= the "from", and < the "to". Thus, if one level is 110.0 to 131.0 and the next level is 131.0 to 144.0, then the value 131.0 will be placed into the second level, not the first.

    Power levels:

    • "ilevels"
    • "classicpower"

    Heart Rate Levels:

    • "classichr"
    • "frielhr"
    • "usachr"
    • "bcfhr"

    Running Pace Levels:

    • "frielpace"
    • "pzipace"

    Examples

    bin(power, "ilevels")

    Places power in iLevel bins.

  • count(values)

    Counts the valid non-zero values in numbers.

    Parameters

    numbers

    A single number, a set of numbers, or a numeric variable.

    Return Value

    The count of the values in numbers.

    Examples

    count({3, 6, 0, 9, na, 12})

    4

    count(heartrate)

    The count of non-zero heart rate values.

  • count(values, groupby)

    Counts the values in numbers, grouped by period.

    Parameters

    numbers

    A single number, a set of numbers, or a numeric variable.

    period

    A period identified by "day", "week", "month" or "year".

    Return Value

    Count of values grouped by groupby.

    Examples

    count(tss, "month")

    The monthly count of tss values.

  • cumsum(numbers)

    Gives the cumulative totals of the addition of all the values in the set of numbers.

    Parameters

    numbers

    A set of numbers.

    Return Value

    The sum of numbers.

    Examples

    cumsum({1,2,3,4,5,6,7,8,9,10})

    Gives the set {1,3,6,10,15,21,28,36,45,55}.

    cumsum(deltadistance)

    Gives cumulative distance, same as the variable elapseddistance.

    cumsum(power * deltatime) / 1000

    Gives cumulative work in kJ.

    cumsum(if(_elevation-shift(_elevation,1)>0,_elevation-shift(_elevation,1)))

    Gives cumulative climbing.

    See Also

    sum(numbers)

  • length(values)

    Gives the count of all values in numbers including zeroes and invalid.

    Parameters

    numbers

    A single number, a set of numbers, or a numeric variable.

    Return Value

    The count of the values in numbers.

    Examples

    length({3, 6, 0, 9, na, 12})

    6

    heartrate[length(heartrate)-1]

    The last heart rate number, equivalent to heartrate[-1].

  • li(pairs, numbers)

    Finds Y values for a given X value using linear interpolation if necessary.

    Parameters

    pairs

    A set of X,Y pairs.

    numbers

    A single number or set of numbers representing X values for which you wish to find the corresponding Y values.

    Return Value

    A set of Y values corresponding to the X values given in numbers.

    Discussion

    Linear interpolation can be helpful to find the exact or approximate Y value using the points nearest the specified X values.

    Examples

    li(elapseddistance, 0:10:00)

    At the workout level, gives the distance at 10 minutes.

    li(yx(metric(elapseddistance)),40.0)

    At the workout level, gives the elapsed duration at 40km.

    li(pdcurve(meanmax(power)),0:20:00)*0.92

    Gives 92% of the modeled 20 minute power.

    li(pdcurve(meanmax(power)),{60,360,1200})

    Gives modeled power at 1min, 5min, and 20min.

    li(yx(pdcurve(meanmax(power))),last(sftp,1)*1.2)

    Gives modeled duration at 120% of sftp.

  • lookup(pairs, numbers)

    Finds Y values for a given X value by searching for the X value equal or lesser than numbers.

    Parameters

    pairs

    A set of X,Y pairs.

    numbers

    A single number or set of numbers representing X values for which you wish to find the corresponding Y values.

    Return Value

    A set of Y values corresponding to the X values given in numbers.

    Discussion

    The lookup function

    Examples

    lookup(weight,enddate)

    Gives the weight that corresponds to the most recent value as of the end date of the currently selected range.

    lookup(bikeftp,begindate)

    Gives the FTP for cycling that corresponds to the most recent value as of the begin date of the currently selected range.

  • meanmax(pairs)

    Searches pairs for durations with maximum average, and creates a mean maximal curve.

    Parameters

    pairs

    A set of pairs, usualy having elapsedtime, elapseddistance, or date for the x value.

    Return Value

    A mean maximal curve, which is a set of pairs with duration as x and average as y.

    Discussion

    A mean maximal search finds continuous durations with the highest average.

    Examples

    meanmax(power)

    Mean maximal power curve

    meanmax(power/weight)

    Mean maximal power to weight curve.

    meanmax(tss)

    Mean maximal tss curve.

    meanmax(if(cumsum(bikepower*deltatime)/1000>1500,bikepower))

    Mean maximal power curve including power only after accumulating 1500kJ.

  • meanmax(pairs, duration)

    Calculates the absolute value of each number value in numbers.

    Parameters

    pairs

    A set of pairs, usualy having elapsedtime, elapseddistance, or date for the x value.

    duration

    One or more numbers specifying a specific duration to search for.

    Return Value

    The mean maximal for each duration specified.

    Examples

    meanmax(power, 0:20:00)

    Gives the best average power for a continuous 20 minute (1200 seconds) duration.

    60 / meanmax(speed, 600)

    Gives the best 10 minute (600 seconds) pace.

    meanmax(if(_elevation-shift(_elevation,1)>0,metric(_elevation-shift(_elevation,1))/deltatime*3600,0),300)

    Searches for the 5 minute period with the highest average VAM.

    metric(60/greatest(meanmax((metric(elapseddistance),runspeed), 5.0), 3))

    Gives the 3 fastest 5K run pace in min/km.

  • meanmaxfrom(pairs, duration)

    Searches for the begin time offset for the mean maximal value.

    Parameters

    pairs

    A set of pairs, usualy having elapsedtime, elapseddistance, or date for the x value.

    duration

    One or more numbers specifying a specific duration to search for.

    Return Value

    The beginning elapsed time for the mean maximal for each duration specified.

    Examples

    meanmaxfrom(power, 0:20:00)

    Gives the start time of the 20 minute duration with the highest average power.

  • meanmaxto(pairs, duration)

    Searches for the end time offset for the mean maximal value.

    Parameters

    pairs

    A set of pairs, usualy having elapsedtime, elapseddistance, or date for the x value.

    duration

    One or more numbers specifying a specific duration to search for.

    Return Value

    The ending elapsed time for the mean maximal for each duration specified.

    Examples

    meanmaxto(power, 0:20:00)

    Gives the end time of the 20 minute duration with the highest average power.

  • pstddev(numbers)

    Calculates the population standard deviation of numbers.

    Parameters

    numbers

    A set of numbers.

    Return Value

    The population standard deviation.

    Examples

    pstddev({1,2,3,4,5,6,7,8,9,10})

    Gives the number 2.8722813.

    pstddev(power)

    Gives the population standard deviation of power data.

    See Also

    stddev(numbers)

  • pvariance(numbers)

    Gives the population variance of numbers.

    Parameters

    numbers

    A set of numbers.

    Return Value

    The population variance of numbers.

    Examples

    pvariance(power)

    At the workout level, gives the population variance of the power channel.

  • recordingrate

    Gets the recording rate of time series data.

  • slr(numbers)

    Calculates the simple linear regression for the values in numbers.

    Parameters

    numbers

    A single number, a set of numbers, or a numeric variable.

    Return Value

    The absolute value of each value in numbers.

    Examples

    slr(tss)

    The trend line for TSS.

  • slrb(numbers)

    Calculates the Y-intercept of the simple linear regression for the values in numbers.

    Parameters

    numbers

    A single number, a set of numbers, or a numeric variable.

    Return Value

    The Y-intercept of the simple linear regression

    Examples

    slrb(tss)

    The Y-intercept of the trend line for TSS.

  • slrm(numbers)

    Calculates the slope of the simple linear regression for the values in numbers.

    Parameters

    numbers

    A single number, a set of numbers, or a numeric variable.

    Return Value

    The slope of the simple linear regression.

    Examples

    slrm(power)

    The slope of the power trend.

  • slrrsq(numbers)

    Calculates the R² value for the simple linear regression. R² is a measure of how close the data are to the fitted regression line.

    Parameters

    numbers

    A single number, a set of numbers, or a numeric variable.

    Return Value

    The R² of the simple linear regression.

    Examples

    slrrsq(power)

    The R² of the line that best fits power data.

  • stddev(numbers)

    Calculates the sample standard deviation of numbers.

    Parameters

    numbers

    A set of numbers.

    Return Value

    The sample standard deviation.

    Examples

    stddev({1,2,3,4,5,6,7,8,9,10})

    Gives the number 3.0276504.

    stddev(if(power>runftp,power))

    Gives the sample standard deviation of power above Run FTP.

  • sum(numbers)

    Gives the total of the addition of all the values in the set of numbers.

    Parameters

    numbers

    A set of numbers.

    Return Value

    The sum of numbers.

    Examples

    sum({1,2,3,4,5,6,7,8,9,10})

    Gives the number 55.

    sum(power * deltatime) / 1000

    Gives work in kJ, same as the variable work.

  • sum(numbers, groupby)

    Gives the total of the addition of all the values in the set of numbers, grouped by groupby.

    Parameters

    numbers

    A set of numbers.

    period

    A period identified by "day", "week", "month" or "year".

    Return Value

    Count of values grouped by groupby.

    Examples

    sum(tss, "week")

    The weekly sum of tss values.

    See Also

    sum(numbers)

  • variance(numbers)

    Gives the variance of numbers.

    Parameters

    numbers

    A set of numbers.

    Return Value

    The variance of numbers.

    Examples

    pvariance(power)

    At the workout level, gives the variance of the power channel.

Training Levels

  • levelcount(levelsname)

    Gives the number of levels in the specified system.

    Parameters

    levelsname

    The name of a training levels system.

    Return Value

    The count of levels.

    Examples

    levelcount("ilevels")

    Gives the number of iLevels, which is 9.

  • levelfrom(levelsname, index)

    Gives the low limit of a training level.

    Parameters

    levelsname

    The name of a training levels system.

    index

    The index of the level.

    Return Value

    The low limit of a training level.

    Discussion

    The first level in any system begins with index 0. The levels you can use for the levelsname parameter are as follows.

    Power levels:

    • "ilevels"
    • "classicpower"

    Heart Rate Levels:

    • "classichr"
    • "frielhr"
    • "usachr"
    • "bcfhr"

    Running Pace Levels:

    • "frielpace"
    • "pzipace"

    Examples

    levelfrom("classicpower",1)

    Gives the lower limit of the second Classic Power level, the value of which depends on your bikethr.

  • levelfrom(meanmaxcurve, index)

    Gives the low limit of an iLevel training level.

    Parameters

    meanmaxcurve

    Mean maximal power curve data, usually meanmax(power).

    index

    The index of the iLevel.

    Return Value

    The low limit of a training level.

    Discussion

    The first level in any system begins with index 0.

    Examples

    levelfrom(meanmax(power),1)

    Gives the lower limit of ilevel 1.

  • levelname(levelsname, index)

    Gives the name of a training level.

    Parameters

    levelsname

    The name of a training levels system.

    index

    The index of the level.

    Return Value

    The name of a specific training level within the traning levels system.

    Discussion

    The first level in any system begins with index 0. The levels you can use for the levelsname parameter are as follows.

    Power levels:

    • "ilevels"
    • "classicpower"

    Heart Rate Levels:

    • "classichr"
    • "frielhr"
    • "usachr"
    • "bcfhr"

    Running Pace Levels:

    • "frielpace"
    • "pzipace"

    Examples

    levelname("classicpower",1)

    Gives the name of the second Classic Power level, which is "Endurance".

  • levelto(levelsname, index)

    Gives the upper limit of a training level.

    Parameters

    levelsname

    The name of a training levels system.

    index

    The index of the level.

    Return Value

    The high limit of a training level.

    Discussion

    The first level in any system begins with index 0. The levels you can use for the levelsname parameter are as follows.

    Power levels:

    • "ilevels"
    • "classicpower"

    Heart Rate Levels:

    • "classichr"
    • "frielhr"
    • "usachr"
    • "bcfhr"

    Running Pace Levels:

    • "frielpace"
    • "pzipace"

    Examples

    levelto("classicpower",0)

    Gives the upper limit of the first Classic Power level, the value of which depends on your bikeftp.

  • levelto(meanmaxcurve, index)

    Gives the upper limit of an iLevel training level.

    Parameters

    meanmaxcurve

    Mean maximal power curve data, usually meanmax(power).

    index

    The index of the iLevel.

    Return Value

    The upper limit of a training level.

    Discussion

    The first level in any system begins with index 0.

    Examples

    levelto(meanmax(power),3)

    Gives the upper limit of ilevel 3.

  • targetduration(levelindex, meanmaxcurve)

    Gives the target duration for a given level.

    Parameters

    levelindex

    The index of the level, a number between 0 and 5.

    meanmaxcurve

    Mean maximal power curve data, usually meanmax(power).

    Return Value

    Target duratin for the level.

    Discussion

    The first level begins with levelindex 0.

    0

    Extensive Aerobic (FTP)

    1

    Intenisve Aerobic (FTP)

    2

    Max Aerobic (VO2 Max Intensive)

    3

    Extensive Anaerobic (FRC)

    4

    Intensive Anaerobic (FRC)

    5

    Max

    Examples

    targetduration(3,meanmax(power))

    Gives the target duration for level 3, Extensive Anaerobic (FRC).

  • targetname(levelindex)

    Gives the name of a target level.

    Parameters

    levelindex

    The index of the level, a number between 0 and 5.

    Return Value

    The name of the specified level.

    Discussion

    The first level begins with levelindex 0.

    0

    Extensive Aerobic (FTP)

    1

    Intenisve Aerobic (FTP)

    2

    Max Aerobic (VO2 Max Intensive)

    3

    Extensive Anaerobic (FRC)

    4

    Intensive Anaerobic (FRC)

    5

    Max

    Examples

    targetname(4)

    Gives the name for level 4, Intensive Anaerobic (FRC).

  • targetpower(levelindex, meanmaxcurve)

    Gives the target power for a given level.

    Parameters

    levelindex

    The index of the level, a number between 0 and 5.

    meanmaxcurve

    Mean maximal power curve data, usually meanmax(power).

    Return Value

    Target power for the level.

    Discussion

    The first level begins with levelindex 0.

    0

    Extensive Aerobic (FTP)

    1

    Intenisve Aerobic (FTP)

    2

    Max Aerobic (VO2 Max Intensive)

    3

    Extensive Anaerobic (FRC)

    4

    Intensive Anaerobic (FRC)

    5

    Max

    Examples

    targetpower(3,meanmax(power))

    Gives the target power for level 3, Extensive Anaerobic (FRC).

Units

  • english(numbers)

    Converts numbers to the English units system.

    Parameters

    numbers

    A set of numbers.

    Return Value

    Converted numbers.

    Discussion

    If the units of numbers is one of the following, the value is converted to its English equivalent. Otherwise no conversion is applied.

    km

    mi

    min/km

    min/mi

    m

    ft

    kg

    lb

    N

    lbf

    km/h

    mi/h

    °C

    °F

    cm

    in

    Examples

    english(temperature)

    If the default units system is metric, converts the temperature data channel from °C to °F.

    See Also

    metric(numbers)

  • metric(numbers)

    Converts numbers to the metric units system.

    Parameters

    numbers

    A set of numbers.

    Return Value

    Converted numbers.

    Discussion

    If the units of numbers is one of the following, the value is converted to its metric equivalent. Otherwise no conversion is applied.

    mi

    km

    min/mi

    min/km

    ft

    m

    lb

    kg

    lbf

    N

    mi/h

    km/h

    °F

    °C

    in

    cm

    Examples

    metric(distance)

    If the default units system is English, converts the workout distance data channel from mi to km.

All Functions

Variables

Alias Variables

  • aepf

    Average Effective Pedal Force

    Discussion

    Average Effective Pedal Force (AEPF) is a calculation that estimates the force applied to the pedal for one complete revolution, often used in Quadrant Analysis charts. The aepf variable is a list of numbers corresponding to force applied to the pedal in Newtons (N).

    Required Data Channels

    cadence

    power

  • cpv

    Circumferential Pedal Velocity

    Discussion

    Circumferential Pedal Velocity is a calculation that corresopnds to how fast the pedal moves around the circle it makes while pedaling and is often used in Quadrant Analysis charts. The cpv variable is a list of numbers corresponding pedal velocity in meters per second (m/s).

    Required Data Channels

    cadence

  • deltadistance

    Change in elapsed distance

    Discussion

    The deltadistance variable is a list of numbers corresponding to the distance travelled between data records. It is a convenient equivalent to delta(elapseddistance) and also to shift(elapseddistance,1)-elapseddistance.

    Required Data Channels

    elapseddistance

  • deltatime

    Change in elapsed time

    Discussion

    The deltatime variable is a list of numbers corresponding to the time elapsed between data records. It is a convenient equivalent to delta(elapsedtime) and also to shift(elapsedtime,1)-elapsedtime.

    Required Data Channels

    elapsedtime

  • ecpower

    Elevation corrected power

    Discussion

    The ecpower data channel is an alternative to power which elevation to normalize data collected at higher elevations to sea-level equivalent. Please read the article on elevation corrected power for more information how to use it.

    Required Data Channels

    elevation

    power

  • gpaleft

    Left side gross power absorbed

    Discussion

    The gpaleft variable corresponds to the left side power in a pedal stroke that does NOT contribute to moving the bicycle forward. This data is available only for power meters that measure and record requires ANT+ pedaling metrics.

    Required Data Channels

    balance

    effectivenessleft

    power

  • gparight

    Right side gross power absorbed

    Discussion

    The gparight variable corresponds to the right side power in a pedal stroke that does NOT contribute to moving the bicycle forward. This data is available only for power meters that measure and record requires ANT+ pedaling metrics.

    Required Data Channels

    balance

    effectivenessright

    power

  • gprleft

    Left side gross power released

    Discussion

    The gparight variable corresponds to the left side power that contributes to moving the bicycle forward. This data is available only for power meters that measure and record requires ANT+ pedaling metrics.

    Required Data Channels

    balance

    effectivenessleft

    power

  • gprright

    Left side gross power released

    Discussion

    The gparight variable corresponds to the right side power that contributes to moving the bicycle forward. This data is available only for power meters that measure and record requires ANT+ pedaling metrics.

    Required Data Channels

    balance

    effectivenessleft

    power

  • kileft

    Left side kurtotic index.

    Discussion

    Kurtotic index is the ratio of the maximum effective pedal force to the average effective pedal force during the power-producing phase of the pedal stroke. Requires ANT+ pedaling metrics.

    Required Data Channels

    effectivenessleft

    smoothnessleft

  • kiright

    Right side kurtotic index.

    Discussion

    Kurtotic index is the ratio of the maximum effective pedal force to the average effective pedal force during the power-producing phase of the pedal stroke. Requires ANT+ pedaling metrics.

    Required Data Channels

    effectivenessright

    smoothnessright

  • mepfleft

    Left side maximum effective pedal force

    Discussion

    Maximum effective pedal force is the maximum pedaling force applied to the pedal that causes the crank to turn around a complete revolution and contributes to effectively moving the bike forward. Requires ANT+ pedaling metrics.

    Required Data Channels

    balance

    cadence

    power

    smoothnessleft

  • mepfright

    Right side maximum effective pedal force

    Discussion

    Maximum effective pedal force is the maximum pedaling force applied to the pedal that causes the crank to turn around a complete revolution and contributes to effectively moving the bike forward. Requires ANT+ pedaling metrics.

    Required Data Channels

    balance

    cadence

    power

    smoothnessright

  • rgrade

    Rolling grade

    Discussion

    Rolling grade is a list of numbers corresponds to the grade for each data record, as opposed to grade which is a single number corresponding to the average grade over a range. Rolling grade is calculated after some smoothing is applied to elevation to minimize obvious noise and measurement errors. The definition of grade is found on Wikipedia and other similar web resources.

    Required Data Channels

    elapseddistance

    elevation

  • rngp

    Rolling normalized graded pace

    Discussion

    Rolling normalized graded pace is a list of numbers corresponding to normalized graded pace for each data record. It estimates the pace that is equivalent to running on flat ground. By normalizing pace to flat ground you can compare efforts on different courses having different elevation profiles.

    Required Data Channels

    elevation

    speed

    See Also

    ngp

  • stamina

    Discussion

    Stamina is a measure of resistance to fatigue during prolonged-duration. Units are percent of maximum, i.e., 0-100%, although most individuals will fall in the 75 to 85 percent range.

    Required Data Channels

    power

    Examples

    stamina

    Gives a stamina number based on workouts in the selected date range.

    ({begindate:enddate},athleterange({begindate:enddate}-89,{begindate:enddate},stamina))

    Gives historical daily stamina numbers based on trailing 90 days.

Athlete Variables

  • age

    Athlete age.

    Discussion

    The age variable corresponds to the athlete's age calculated using today's date and the athlete's birth date set on the Athlete Details tab.

  • athletetags

    Discussion

    This is a list of the tags assigned to this athlete. Athlete tags can be set using the Athlete Details tab. There can be zero, one, or many tags in the list for each athlete.

    Examples

    max(athletetags="current")

    Gives 1 if any of the athlete tags is equal to "current". Otherwise it gives 0.

  • atl

    Acute Training Load

    Discussion

    ATL is an exponentially weighted rolling average that corresponds to your recent or short-term training load based on atlconstant days. This variable is a shortcut for the expression tl(tss,atlconstant).

    See Also

    ctl

    tsb

    ramprate

  • atlconstant

    Acute Training Load (ATL) constant

    Discussion

    The ATL constant is an exponential decay rate use calculate to acute (recent) training load. You can change the atlconstant variable by double-clicking ATL in the athlete bar at the top of the WKO main window. The default is 7 days.

    Examples

    tl(tss,atlconstant)

    Gives acute training load (ATL) based on the atlconstant for the current athlete.

  • bikeftp

    Historical functional threshold power (FTP) setting for Bike

    Discussion

    At the athlete level, bikeftp corresponds list of daily numbers corresponding to historical Bike FTP setting. At the workout level, bikeftp gives the Bike FTP setting as of the day of the workout. You can enter changes to the Bike FTP setting based on date using the Athlete Details tab.

    Examples

    bin(power, {0.7, 0.8, 0.9, 1.0, 1.1} * bikeftp)

    At the athlete level, bins power into 6 levels based on zones calculated using a percentage of historical Bike FTP values.

  • bikemhr

    Historical maximum heart rate for Bike

    Discussion

    At the athlete level, bikemhr corresponds list of daily numbers corresponding to historical maximum heart rate. At the workout level, bikemhr gives the maximum heart rate as of the day of the workout. You can enter changes to maximum heart rate based on date using the Athlete Details tab.

    Examples

    bin(heartrate, {0.7, 0.8, 0.9} * bikemhr)

    At the athlete level, bins heart rate into 4 levels based on zones calculated using a percentage of historical maximum heart rate values.

  • bikethr

    Historical threshold heart rate for Bike

    Discussion

    At the athlete level, bikethr corresponds list of daily numbers corresponding to historical threshold heart rate. At the workout level, bikethr gives the threshold heart rate as of the day of the workout. You can enter changes to threshold heart rate based on date using the Athlete Details tab.

    Examples

    bin(heartrate, {0.7, 0.8, 0.9, 1.0, 1.1} * bikethr)

    At the athlete level, bins heart rate into 6 levels based on zones calculated using a percentage of historical threshold heart rate values.

  • biketpace

    Historical threshold run pace for Bike

    Discussion

    At the athlete level, biketpace corresponds list of daily numbers corresponding to historical threshold pace. At the workout level, biketpace gives the threshold run pace as of the day of the workout. You can enter changes to threshold run pace based on date using the Athlete Details tab.

    Examples

    bin(speed, {0.7, 0.8, 0.9, 1.0, 1.1} * 60/biketpace)

    At the athlete level, bins pace into 6 levels based on zones calculated using a percentage of historical threshold pace values.

  • cranklength

    Crank arm length

    Discussion

    This variable is likely to be replaced in the future. It is recommended to avoid using it. Instead, assign your own variable like @cranklength:=170.

  • ctl

    Chronic Training Load

    Discussion

    ATL is an exponentially weighted rolling average that corresponds to your longer-term training load based on ctlconstant days. This variable is a shortcut for the expression tl(tss,ctlconstant).

    See Also

    atl

    tsb

    ramprate

  • ctlconstant

    Chronic Training Load (CTL) constant

    Discussion

    The CTL constant is an exponential decay rate use calculate to chronic (historical) training load. You can change the ctlconstant variable by double-clicking CTL in the athlete bar at the top of the WKO main window. The default is 42 days.

    Examples

    tl(tss,ctlconstant)

    Gives acute training load (CTL) based on the ctlconstant for the current athlete.

  • gender

    Athlete gender

    Discussion

    The gender variable corresponds to the athlete's gender as entered on the Athlete Details tab. Possible values are either "male" or "female".

    Examples

    pdcurve("excellent", gender)

    Gives a power-duration curve standard line for "excellent" athletes based on the gender selected on the Athlete Details tab.

  • indoorbikeftp

    Historical functional threshold power (FTP) setting for Indoor Bike

    Discussion

    At the athlete level, indoorbikeftp corresponds list of daily numbers corresponding to historical Indoor Bike FTP setting. At the workout level, indoorbikeftp gives the Indoor Bike FTP setting as of the day of the workout. You can enter changes to the Indoor Bike FTP setting based on date using the Athlete Details tab.

    Examples

    bin(power, {0.7, 0.8, 0.9, 1.0, 1.1} * indoorbikeftp)

    At the athlete level, bins power into 6 levels based on zones calculated using a percentage of historical Indoor Bike FTP values.

  • indoorbikemhr

    Historical maximum heart rate for Indoor Bike

    Discussion

    At the athlete level, indoorbikemhr corresponds list of daily numbers corresponding to historical maximum heart rate. At the workout level, indoorbikemhr gives the maximum heart rate as of the day of the workout. You can enter changes to maximum heart rate based on date using the Athlete Details tab.

    Examples

    bin(heartrate, {0.7, 0.8, 0.9} * indoorbikemhr)

    At the athlete level, bins heart rate into 4 levels based on zones calculated using a percentage of historical maximum heart rate values.

  • indoorbikethr

    Historical threshold heart rate for Indoor Bike

    Discussion

    At the athlete level, indoorbikethr corresponds list of daily numbers corresponding to historical threshold heart rate. At the workout level, indoorbikethr gives the threshold heart rate as of the day of the workout. You can enter changes to threshold heart rate based on date using the Athlete Details tab.

    Examples

    bin(heartrate, {0.7, 0.8, 0.9, 1.0, 1.1} * indoorbikethr)

    At the athlete level, bins heart rate into 6 levels based on zones calculated using a percentage of historical threshold heart rate values.

  • indoorbiketpace

    Historical threshold run pace for Bike

    Discussion

    At the athlete level, indoorbiketpace corresponds list of daily numbers corresponding to historical threshold pace. At the workout level, indoorbiketpace gives the threshold run pace as of the day of the workout. You can enter changes to threshold run pace based on date using the Athlete Details tab.

    Examples

    bin(speed, {0.7, 0.8, 0.9, 1.0, 1.1} * 60/indoorbiketpace)

    At the athlete level, bins pace into 6 levels based on zones calculated using a percentage of historical threshold pace values.

  • otherftp

    Historical functional threshold power (FTP) setting for Other

    Discussion

    At the athlete level, otherftp corresponds list of daily numbers corresponding to historical Other FTP setting. At the workout level, otherftp gives the Other FTP setting as of the day of the workout. You can enter changes to the Other FTP setting based on date using the Athlete Details tab.

    Examples

    bin(power, {0.7, 0.8, 0.9, 1.0, 1.1} * otherftp)

    At the athlete level, bins power into 6 levels based on zones calculated using a percentage of historical Other FTP values.

  • othermhr

    Historical maximum heart rate for Other

    Discussion

    At the athlete level, bikemhr corresponds list of daily numbers corresponding to historical maximum heart rate. At the workout level, othermhr gives the maximum heart rate as of the day of the workout. You can enter changes to maximum heart rate based on date using the Athlete Details tab.

    Examples

    bin(heartrate, {0.7, 0.8, 0.9} * othermhr)

    At the athlete level, bins heart rate into 4 levels based on zones calculated using a percentage of historical maximum heart rate values.

  • otherthr

    Historical threshold heart rate for Other

    Discussion

    At the athlete level, otherthr corresponds list of daily numbers corresponding to historical threshold heart rate. At the workout level, otherthr gives the threshold heart rate as of the day of the workout. You can enter changes to threshold heart rate based on date using the Athlete Details tab.

    Examples

    bin(heartrate, {0.7, 0.8, 0.9, 1.0, 1.1} * otherthr)

    At the athlete level, bins heart rate into 6 levels based on zones calculated using a percentage of historical threshold heart rate values.

  • othertpace

    Historical threshold run pace for Other

    Discussion

    At the athlete level, othertpace corresponds list of daily numbers corresponding to historical threshold pace. At the workout level, othertpace gives the threshold run pace as of the day of the workout. You can enter changes to threshold run pace based on date using the Athlete Details tab.

    Examples

    bin(speed, {0.7, 0.8, 0.9, 1.0, 1.1} * 60/othertpace)

    At the athlete level, bins pace into 6 levels based on zones calculated using a percentage of historical threshold run pace values.

  • rampconstant

    Number of days used to calculate ramp rate

    Discussion

    The rampconstant is a number of days used to calculate ramp rate, usually 7, 14, or 21. The ramp rate tells how quickly you are changing volume of training. The default is 21 days, meaning that ramprate gives the change in Chronic Training Load averaged over a 3 week period but normalized per week.

    Examples

    (tl(tss,ctlconstant)-shift(tl(tss,ctlconstant),rampconstant))/(rampconstant/7)

    Calculates the weekly CTL ramp rate based on change over rampconstant days.

    See Also

    ramprate

  • ramprate

    Ramp Rate

    Discussion

    Ramp Rate is the rate at which (Chronic Training Load) (CTL) is rising or declining normalized per week.

    See Also

    atl

    ctl

    tsb

  • rowftp

    Historical functional threshold power (FTP) setting for Row

    Discussion

    At the athlete level, rowftp corresponds list of daily numbers corresponding to historical Row FTP setting. At the workout level, rowftp gives the Row FTP setting as of the day of the workout. You can enter changes to the Row FTP setting based on date using the Athlete Details tab.

    Examples

    bin(power, {0.7, 0.8, 0.9, 1.0, 1.1} * rowftp)

    At the athlete level, bins power into 6 levels based on zones calculated using a percentage of historical Row FTP values.

  • rowmhr

    Historical maximum heart rate for Row

    Discussion

    At the athlete level, rowmhr corresponds list of daily numbers corresponding to historical maximum heart rate. At the workout level, rowmhr gives the maximum heart rate as of the day of the workout. You can enter changes to maximum heart rate based on date using the Athlete Details tab.

    Examples

    bin(heartrate, {0.7, 0.8, 0.9} * rowmhr)

    At the athlete level, bins heart rate into 4 levels based on zones calculated using a percentage of historical maximum heart rate values.

  • rowthr

    Historical threshold heart rate for Row

    Discussion

    At the athlete level, rowthr corresponds list of daily numbers corresponding to historical threshold heart rate. At the workout level, rowthr gives the threshold heart rate as of the day of the workout. You can enter changes to threshold heart rate based on date using the Athlete Details tab.

    Examples

    bin(heartrate, {0.7, 0.8, 0.9, 1.0, 1.1} * rowthr)

    At the athlete level, bins heart rate into 6 levels based on zones calculated using a percentage of historical threshold heart rate values.

  • rowtpace

    Historical threshold run pace for Row

    Discussion

    At the athlete level, rowtpace corresponds list of daily numbers corresponding to historical threshold pace. At the workout level, rowtpace gives the threshold run pace as of the day of the workout. You can enter changes to threshold run pace based on date using the Athlete Details tab.

    Examples

    bin(speed, {0.7, 0.8, 0.9, 1.0, 1.1} * 60/rowtpace)

    At the athlete level, bins pace into 6 levels based on zones calculated using a percentage of historical threshold pace values.

  • runftp

    Historical functional threshold power (FTP) setting for Run

    Discussion

    At the athlete level, runftp corresponds list of daily numbers corresponding to historical Run FTP setting. At the workout level, runftp gives the Run FTP setting as of the day of the workout. You can enter changes to the Run FTP setting based on date using the Athlete Details tab.

    Examples

    bin(power, {0.7, 0.8, 0.9, 1.0, 1.1} * runftp)

    At the athlete level, bins power into 6 levels based on zones calculated using a percentage of historical Run FTP values.

  • runmhr

    Historical maximum heart rate for Run

    Discussion

    At the athlete level, runmhr corresponds list of daily numbers corresponding to historical maximum heart rate. At the workout level, runmhr gives the maximum heart rate as of the day of the workout. You can enter changes to maximum heart rate based on date using the Athlete Details tab.

    Examples

    bin(heartrate, {0.7, 0.8, 0.9} * runmhr)

    At the athlete level, bins heart rate into 4 levels based on zones calculated using a percentage of historical maximum heart rate values.

  • runthr

    Historical threshold heart rate for Run

    Discussion

    At the athlete level, runthr corresponds list of daily numbers corresponding to historical threshold heart rate. At the workout level, runthr gives the threshold heart rate as of the day of the workout. You can enter changes to threshold heart rate based on date using the Athlete Details tab.

    Examples

    bin(heartrate, {0.7, 0.8, 0.9, 1.0, 1.1} * runthr)

    At the athlete level, bins heart rate into 6 levels based on zones calculated using a percentage of historical threshold heart rate values.

  • runtpace

    Historical threshold run pace for Run

    Discussion

    At the athlete level, runtpace corresponds list of daily numbers corresponding to historical threshold pace. At the workout level, runtpace gives the threshold run pace as of the day of the workout. You can enter changes to threshold run pace based on date using the Athlete Details tab.

    Examples

    bin(speed, {0.7, 0.8, 0.9, 1.0, 1.1} * 60/runtpace)

    At the athlete level, bins pace into 6 levels based on zones calculated using a percentage of historical threshold pace values.

  • sftp

    Historical functional threshold power (FTP) setting for Bike

    Discussion

    The sftp variable is deprecated. The sftp variable gives bikeftp. You should use bikeftp directly, instead of sftp.

  • skiftp

    Historical functional threshold power (FTP) setting for Ski

    Discussion

    At the athlete level, skiftp corresponds list of daily numbers corresponding to historical Ski FTP setting. At the workout level, skiftp gives the Ski FTP setting as of the day of the workout. You can enter changes to the Ski FTP setting based on date using the Athlete Details tab. We don't know of any power meters for outdoor skiing yet, but there are some indoor Ski Erg products that measure power.

    Examples

    bin(power, {0.7, 0.8, 0.9, 1.0, 1.1} * skiftp)

    At the athlete level, bins power into 6 levels based on zones calculated using a percentage of historical Ski FTP values.

  • skimhr

    Historical maximum heart rate for Ski

    Discussion

    At the athlete level, skimhr corresponds list of daily numbers corresponding to historical maximum heart rate. At the workout level, skimhr gives the maximum heart rate as of the day of the workout. You can enter changes to maximum heart rate based on date using the Athlete Details tab.

    Examples

    bin(heartrate, {0.7, 0.8, 0.9} * skimhr)

    At the athlete level, bins heart rate into 4 levels based on zones calculated using a percentage of historical maximum heart rate values.

  • skithr

    Historical threshold heart rate for Ski

    Discussion

    At the athlete level, skithr corresponds list of daily numbers corresponding to historical threshold heart rate. At the workout level, skithr gives the threshold heart rate as of the day of the workout. You can enter changes to threshold heart rate based on date using the Athlete Details tab.

    Examples

    bin(heartrate, {0.7, 0.8, 0.9, 1.0, 1.1} * skithr)

    At the athlete level, bins heart rate into 6 levels based on zones calculated using a percentage of historical threshold heart rate values.

  • skitpace

    Historical threshold run pace for Ski

    Discussion

    At the athlete level, skitpace corresponds list of daily numbers corresponding to historical threshold pace. At the workout level, skitpace gives the threshold run pace as of the day of the workout. You can enter changes to threshold run pace based on date using the Athlete Details tab.

    Examples

    bin(speed, {0.7, 0.8, 0.9, 1.0, 1.1} * 60/skitpace)

    At the athlete level, bins pace into 6 levels based on zones calculated using a percentage of historical threshold pace values.

  • swimftp

    Historical functional threshold power (FTP) setting for Swim

    Discussion

    At the athlete level, swimftp corresponds list of daily numbers corresponding to historical Swim FTP setting. We don't know of any power meters for swimming yet.

  • swimmhr

    Historical maximum heart rate for Swim

    Discussion

    At the athlete level, swimmhr corresponds list of daily numbers corresponding to historical maximum heart rate. At the workout level, swimmhr gives the maximum heart rate as of the day of the workout. You can enter changes to maximum heart rate based on date using the Athlete Details tab.

    Examples

    bin(heartrate, {0.7, 0.8, 0.9} * swimmhr)

    At the athlete level, bins heart rate into 4 levels based on zones calculated using a percentage of historical maximum heart rate values.

  • swimthr

    Historical threshold heart rate for Swim

    Discussion

    At the athlete level, swimthr corresponds list of daily numbers corresponding to historical threshold heart rate. At the workout level, swimthr gives the threshold heart rate as of the day of the workout. You can enter changes to threshold heart rate based on date using the Athlete Details tab.

    Examples

    bin(heartrate, {0.7, 0.8, 0.9, 1.0, 1.1} * swimthr)

    At the athlete level, bins heart rate into 6 levels based on zones calculated using a percentage of historical threshold heart rate values.

  • swimtpace

    Historical threshold run pace for Swim

    Discussion

    At the athlete level, swimtpace corresponds list of daily numbers corresponding to historical threshold pace. At the workout level, swimtpace gives the threshold run pace as of the day of the workout. You can enter changes to threshold run pace based on date using the Athlete Details tab.

    Examples

    bin(speed, {0.7, 0.8, 0.9, 1.0, 1.1} * 60/swimtpace)

    At the athlete level, bins pace into 6 levels based on zones calculated using a percentage of historical threshold pace values.

  • tcadence

    Historical threshold cadence

    Discussion

    At the athlete level, tcadence corresponds list of daily numbers corresponding to threshold cadence. At the workout level, tcadence gives the threshold cadence as of the day of the workout. You can enter changes to threshold cadence based on date using the Athlete Details tab.

    Examples

    bin(bikepower, tcadence)

    At the athlete level, bins power into 2 bins, above and below threshold cadence.

  • tsb

    Training Stress Balance

    Discussion

    TSB is the difference between CTL and ATL shifted one day into the future, giving insight into an athlete's readiness to perform at peak. This variable is a shortcut for the expression tl(tss,ctlconstant) - tl(tss,ctlconstant).

    See Also

    atl

    ctl

    ramprate

  • weight

    Historical body weight

    Discussion

    At the athlete level, mhr corresponds list of daily numbers corresponding to historical maximum heart rate. At the workout level, mhr gives the maximum heart rate as of the day of the workout. You can enter changes to maximum heart rate based on date using the Athlete Details tab.

    Examples

    max(power/weight)

    Gives the maximum power to weight ratio, based on historical weight settings.

Channel Variables

Channel variables can be prefixed with bike, run, swim, row, ski, other to make them specific to a sport type.

  • _elevation

    Smoothed elevation values.

    Units

    In metric elevation is given in meters, and in English it's given in feet.

  • balance

    Power balance

    Discussion

    Balance is the ratio of right leg contribution to power as a number between 0 and 1 as measured/recorded by a device.

  • cadence

    Discussion

    Cadence is the number of complete cycles per minute as measured/recorded by a device. In cycling it is the number of 360 degree revolutions of the pedals. In running it is the number of left and right footfals (two steps) per minute.

  • effectivenessleft

    Torque effectiveness left side

    Discussion

    This is a Garmin pedaling metric as measured/recorded by a device. It is only available if both your power meter and recording device supports it.

  • effectivenessright

    Torque effectiveness right side

    Discussion

    This is a Garmin pedaling metric as measured/recorded by a device. It is only available if both your power meter and recording device supports it.

  • elapseddistance

    Elapsed Distance

    Discussion

    This is a data channel giving the cumulative distance covered starting with zero, as measured/recorded by a device.

  • elapsedtime

    A data channel (a set of numbers) that lists the cumulative duration for each data record. The expression max(elapsedtime) should return the same number as the expression elapsedduration

  • elevation

    Elevation values as recorded by a device.

    Units

    In metric elevation is given in meters, and in English it's given in feet.

  • frontgear

    Gives the number of teeth on the front chainring selected.

    Discussion

    The front gear selection is given by the number of teeth on the chainring.

    See Also

    reargear

  • heartrate

    Heart Rate

    Discussion

    This is the heart rate data channel giving the number of beats per minute as measured/recorded by a device.

  • hrv

    Heart Rate Variability

    Discussion

    This is a data channel giving the elapsed time between heart beats as measured/recorded by a device.

  • latitude

    Latitude

    Discussion

    This is the degrees latitude data channel as measured/recorded by a device.

  • leftpco

    Discussion

    Left side platform center offset as measured/recorded by a device. Requires a device that supports Garmin Cycling Dynamics.

  • leftppend

    Discussion

    Left side power phase end angle as measured/recorded by a device. Requires a device that supports Garmin Cycling Dynamics.

  • leftpppend

    Discussion

    Left side power phase peak start angle as measured/recorded by a device. Requires a device that supports Garmin Cycling Dynamics.

  • leftpppstart

    Discussion

    Left side power phase peak start angle as measured/recorded by a device. Requires a device that supports Garmin Cycling Dynamics.

  • leftppstart

    Discussion

    Left side power phase start angle as measured/recorded by a device. Requires a device that supports Garmin Cycling Dynamics.

  • longitude

    Longitude

    Discussion

    This is the degrees longitude data channel as measured/recorded by a device.

  • power

    Cycling or Running Power

    Discussion

    This is the power data channel as measured/recorded by a device.

  • reargear

    Gives the number of teeth on the rear cog selected.

    Discussion

    The rear gear selection is given by the number of teeth on the rear cog.

    See Also

    frontgear

  • riderposition

    Rider Position

    Discussion

    This is the rider position, either "standing" or "seated", as measured/recorded by a device that supports Garmin Cycling Dynamics.

  • rightpco

    Discussion

    Right side platform center offset as measured/recorded by a device. Requires a device that supports Garmin Cycling Dynamics.

  • rightppend

    Discussion

    Right side power phase end angle as measured/recorded by a device. Requires a device that supports Garmin Cycling Dynamics.

  • rightpppend

    Discussion

    Right side power phase peak start angle as measured/recorded by a device. Requires a device that supports Garmin Cycling Dynamics.

  • rightpppstart

    Discussion

    Right side power phase peak start angle as measured/recorded by a device. Requires a device that supports Garmin Cycling Dynamics.

  • rightppstart

    Discussion

    Right side power phase start angle as measured/recorded by a device. Requires a device that supports Garmin Cycling Dynamics.

  • runsmoothness

    Running Smoothness

    Discussion

    Running smoothness data channel as measured/recorded by a device.

  • sathb

    Discussion

    Saturation of O₂ as a percent as measured/recorded by a device.

  • smoothness

    Pedaling Smoothness

    Discussion

    Pedaling smoothness data channel as measured/recorded by a device. Requires a device that supports ANT+ pedaling metrics.

  • smoothnessleft

    Left Side Pedaling Smoothness

    Discussion

    Pedaling smoothness data channel as measured/recorded by a device. Requires a device that supports ANT+ pedaling metrics.

  • smoothnessright

    Right Side Pedaling Smoothness

    Discussion

    Pedaling smoothness data channel as measured/recorded by a device. Requires a device that supports ANT+ pedaling metrics.

  • speed

    Discussion

    Speed data channel as measured/recorded by a device.

  • stancetime

    Discussion

    Stance time data channel as measured/recorded by a device.

  • stancetimepercent

    Discussion

    Stance Time Percent data channel as measured/recorded by a device.

  • strokecount

    Discussion

    Swimming stroke count data channel as measured/recorded by a device.

  • stroketype

    Discussion

    Swimming stroke type data channel as measured/recorded by a device.

  • temperature

    Discussion

    Temperature data channel as measured/recorded by a device.

  • totalhb

    Discussion

    Total concentration of hemoglobin as measured/recorded by a device.

  • verticaloscillation

    Discussion

    Vertical movement data channel as measured/recorded by a device.

Constants

  • e

    Discussion

    Euler's number: 2.7182818284590452.

  • g

    Discussion

    Approxmiation of acceleration due to Earth gravity: 9.80665 m/s².

  • na

    Discussion

    No number, not a number, or not available. The function isvalid(na) gives zero (false).

  • pi

    Discussion

    The ratio of a circle's circumference to its diameter: 3.1415926535897932.

Other Variables

  • firstworkoutdate

    Discussion

    This is the date of the oldest workout for the athlete.

  • lastworkoutdate

    Discussion

    This is the date of the newest workout for the athlete.

  • now

    Discussion

    This is today's date and time.

    See Also

    today

  • today

    Discussion

    This is today's date, with no time.

    See Also

    now

Range Variables

  • begindate

    Discussion

    The start date offset of the range selected in the RHE.

  • begindistance

    Discussion

    The start distance offset of the range selected in the RHE.

  • begintime

    Discussion

    The start time offset of the range selected in the RHE.

  • climbing

    Discussion

    Vertical ascending distance travelled in the currently selected RHE range.

  • descending

    Discussion

    Vertical descending distance travelled in the currently selected RHE range.

  • distance

    Discussion

    Distance travelled in the currently selected RHE range.

  • duration

    Discussion

    The sum of the duration of all records while your device is recording data. There are a few circumstances in which a device might not record data: The device has a pause button that temporarily suspends recording. The device has an auto-pause mode that suspends recording based on some circumstance. Interference that temporarily prevents the device from receiving wireless data from sensors. We also refer to duration as "recording duration." It most frequently matches what's reported as "duration" by TrainingPeaks, Garmin Connect, Strava, and others, which is why we named it so. This is also the duration that WKO displays in the Left-Hand Explorer (LHE) and Right-Hand Explorer (RHE) when duration is listed there.

  • ef

    Efficiency Factor

    Discussion

    This is the efficiency factor calculated by WKO.

  • elapsedduration

    The total duration of the workout. It is equal to the end time minus the start time.

  • elevationchange

    Discussion

    This is the total change in elevation calculated by taking the ending elevation minus the starting elevation.

  • enddate

    Discussion

    This is the end date of the range selected in the right hand explorer (RHE) at the athlete level.

  • enddistance

    Discussion

    This is the ending distance of the range selected in the right hand explorer (RHE) at the workout level.

  • endtime

    Discussion

    This is the ending elapsed time of the range selected in the right hand explorer (RHE) at the workout level.

  • grade

    Discussion

    This is average grade for the range selected in the right hand explorer (RHE) at the workout level.

  • if

    Intensity Factor

    Discussion

    This is the intensity factor calculated for the range selected in the right hand explorer (RHE) at the workout level.

  • movingduration

    The sum of duration while moving.

  • ngp

    Normalized Graded Pace

    Discussion

    This is the NGP for run workouts calculated for the range selected in the right hand explorer (RHE) at the workout level.

  • np

    Normalized Power ; ;Discussion This is the NGP for run workouts calculated for the range selected in the right hand explorer (RHE) at the workout level.

  • pahr

    Percentage change of pace to heart rate ratio

    Discussion

    The pahr variable attempts to quantify cardiac drift by showing the percentage change in the ratio of average pace to average heart rate of the first half of a workout or workout range, compared to the second half. Read the TrainingPeaks.com article about aerobic decoupling.

  • pedalingduration

    The sum of the duration of all records where cadence is not zero.

  • pwhr

    Percentage change of power to heart rate ratio

    Discussion

    The pwhr variable attempts to quantify cardiac drift by showing the percentage change in the ratio of average power to average heart rate of the first half of a workout or workout range, compared to the second half. Read the TrainingPeaks.com article about aerobic decoupling.

  • tss

    Training Stress Score

    Discussion

    This is power based training stress calculated for the range selected in the right hand explorer (RHE) at the workout level.

  • tssduration

    Training Stress Score Duration

    Discussion

    This is duration used to calculated TSS for the range selected in the right hand explorer (RHE) at the workout level.

  • vam

    Vertical Ascent Rate

    Discussion

    This is vertical ascent rate calculated for the range selected in the right hand explorer (RHE) at the workout level.

  • vi

    Variability Index

    Discussion

    This is ratio of normalized power to average power calculated for the range selected in the right hand explorer (RHE) at the workout level.

  • work

    Discussion

    This is the energy in kJ for the range selected in the right hand explorer (RHE) at the workout level.

Workout Variables

  • build

    Discussion

    This is the build of WKO used to create the current file.

  • channels

    Discussion

    This is a list of data channels available in a workout.

  • code

    Discussion

    This is the workout code as entered on the Workout Details tab.

  • date

    Discussion

    This is the date and time of the start of a workout.

  • desc

    Discussion

    This is the description of a workout as entered on the Workout Details tab. It is an abbreviation for description.

  • description

    Discussion

    This is the description of a workout as entered on the Workout Details tab.

  • devices

    Discussion

    This is a list of devices used to record data in a workout file.

  • filepath

    Discussion

    This is the path of a workout file.

  • notes

    Discussion

    This is a collection of notes for a workout as entered on the Workout Details tab.

  • planneddistance

    Discussion

    The distance that was planned in advance of the workout as entered on the Workout Details tab.

  • plannedduration

    Discussion

    The duration that was planned in advance of the workout as entered on the Workout Details tab.

  • plannedtss

    Discussion

    The Training Stress Score (TSS) that was planned in advance of the workout as entered on the Workout Details tab.

  • plannedwork

    Discussion

    The work that was planned in advance of the workout as entered on the Workout Details tab.

  • poollength

    The length of the pool.

    Discussion

    For swim workouts, the poollength variable gives the length of the pool as indicated by the device, in meters or yards depending on the selected units system.

  • sport

    Discussion

    The sport variable gives the category of sport type (subsport) assigned to a workout. This is useful when you want to reference all sport types within a broader category without having to reference each subsport within that category.

    • Bike All sports riding a bike: Road Bike, Mountain Bike, Indoor Bike
    • Run Weight-bearing sports: Run, Walk
    • Swim Swimming sports: Swim
    • Row Sports in water craft propelled with a blade or paddle: Row
    • Ski Skiing: XC Ski
    • Other Non-endurance sports: Day Off, Strength, Other

    See Also

    subsport

  • subsport

    Discussion

    The subsport variable gives the specific sport type assigned to a workout.

    • Road Bike
    • Mountain Bike
    • Run
    • Walk
    • Swim
    • Row
    • XC Ski
    • Day Off
    • Strength
    • Other

    See Also

    sport

  • tags

    Discussion

    These are user-supplied tags to help searching and filtering workouts, as entered on the Workout Details tab.

  • title

    Discussion

    This is the title of the workout as entered on the Workout Details tab.

  • unread

    Viewed or not viewed status of a workout.

    Discussion

    The unread variable is true for workouts that are downloaded or imported but not yet viewed. Unread workouts are shown in bold font in the Left Hand Explorer, and then switch to a regular font after they are viewed. This variable is useful to type in the filter box at the top of the Left Hand Explorer to include only unread workouts.

  • workouttags

    Discussion

    This is a list of the tags assigned to this workout. Workout tags can be set using the Workout Details tab. There can be zero, one, or many tags in the list for each workout.

    Examples

    max(workouttags="sst")

    Gives 1 if any of the workouts tags for each workout is equal to "sst". Otherwise it gives 0.

Metrics Variables

All Variables

Operators

  • !

    Evaluates unary not value.

    Examples

    !0

    1

    !1

    0

  • !=

    Compares lhs not equal to rhs.

    Examples

    1!=2

    1

    5!=3

    1

    7!=7

    0

  • &&

    Evaluates lhs and rhs.

    Examples

    1 && 1

    1

    1 && 0

    0

    0 && 1

    0

    0 && 0

    0

  • *

    Multiplies lhs * rhs.

    Examples

    7*5

    35

    6*0

    0

  • +

    Adds lhs + rhs.

    Examples

    1+2

    3

    4+0

    4

  • -

    Subtracts lhs - rhs.

    Examples

    1-2

    • 1

    4-3

    1

  • /

    Divides lhs / rhs.

    Examples

    1/2

    0.5

    7/5

    1.4

    3/0

    Undefined (--)

  • :=

    Assigns a user-defined variable.

    Examples

    @mftp := athleterange(date-89, date, ftp(meanmax(power)))

    Assigns @mftp.

    @mftp := athleterange(date-89, date, ftp(meanmax(power))), @mftp*0.90

    Assigns @mftp and then gives 90% of mFTP.

  • <

    Compares lhs less than rhs.

    Examples

    1<2

    1

    5<3

    0

    7<7

    0

  • <=

    Compares lhs less than or equal to rhs.

    Examples

    1<=2

    1

    5<=3

    0

    7<=7

    1

  • <>

    Compares lhs not equal to rhs.

    Examples

    1!=2

    1

    5!=3

    1

    7!=7

    0

  • =

    Compares lhs equal to rhs.

    Examples

    1!=2

    1

    5!=3

    1

    7!=7

    0

  • >

    Compares lhs greater than rhs.

    Examples

    1>2

    0

    5>3

    1

    7>7

    0

  • >=

    Compares lhs greater than or equal to rhs.

    Examples

    1>=2

    0

    5>=3

    1

    7>=7

    1

  • []

    Subscript operator.

    Access one element of a set using the subscript operator. The index is zero-based.

    {1:9}

    {1,2,3,4,5,6,7,8,9}

    {1:9}[0]

    {1}

    {1:9}[6]

    {7}

    {1:9}[8]

    {9}

    Select a subset containing of multiple elements using the form [from:to].

    {1:9}[4:6]

    {5,6,7}

    Negative indexes mean start counting from the right instead of the left.

    {1:9}[-1]

    {9}

    {1:9}[-9]

    {1}

    {1:9}[-6]

    {4}

    Accessing elements before the beginning or past the end return undefined (--).

    {1:9}[9]

    Undefined (--)

    {1:9}[-10]

    Undefined (--)

    Leave out the "from" index to start at the beginning.

    {1:9}[:6]

    {1,2,3,4,5,6,7}

    {1:9}[:-6]

    {1,2,3,4}

    Leave out the "to" index go to the end.

    {1:9}[6:]

    {7,8,9}

    {1:9}[-6:]

    {4,5,6,7,8,9}

  • ^

    Calculates lhs ^ rhs, which raises lhs to the rhs power.

    Examples

    4^2

    16

    3^5

    243

    64^(1/2)

    8

  • and

    Evaluates lhs and rhs.

    Examples

    1 and 1

    1

    1 and 0

    0

    0 and 1

    0

    0 and 0

    0

  • not

    Evaluates unary not value.

    Examples

    not 0

    1

    not 1

    0

  • or

    Evaluates lhs or rhs.

    Examples

    1 or 1

    1

    1 or 0

    1

    0 or 1

    1

    0 or 0

    0

  • ||

    Evaluates lhs or rhs.

    Examples

    1 || 1

    1

    1 || 0

    1

    0 || 1

    1

    0 || 0

    0

Data Types

  • Date

    A date formatted according to the computer's regionol settings. Examples are:

    11/5/1967

    5/11/67

  • Number

    A positive or negative real number composed of the digits 0-9, decimal point, and positive or negative sign. Examples are:

    1

    1.

    1.0

    +0.9

    .765

    -1234.56

  • Pair

    An (x,y) ordered pair of data items. Examples are:

    (123, 456)

    A point at coordinates x=123 and y=456.

    ( , 456)

    A horizontal line at y=456.

    (789, )

    A vertical line at x=789.

  • Set

    A list of zero or more data items of any type enclosed in brackets and separated by commas. Examples are:

    {}

    An empty set.

    {1, 2, 3, 4.5, 5}

    A set of 5 numbers.

    {"Recovery", Endurance", "Threshold"}

    A set of three strings.

    There are also some shortcuts for entering pairs. One form is {from:to:step}. Examples are:

    {3:6}

    {3,4,5,6}

    {1:10:2}

    {1, 3, 5, 7, 9}

    {12:3:-4,1,2,3}

    {12, 8, 4, 1, 2, 3}

    Another form is {value;repeat}. Examples are:

    {5;3}

    {5,5,5}

    {7;4,5,3,1}

    {7,7,7,7,5,3,1}

    {11;3,13;4}

    {11, 11, 11, 13, 13, 13, 13}

  • String

    A list of zero or more characters enclosed in double quotes. Examples are:

    "ilevels"

    "Endurance"

    ""

  • Time

    A time or duration formatted according to the computer's regionol settings. Examples are:

    1:00:00

    0:20:00

    0:00:01

Syntax/Grammar

expression

atom[yunits][binaryoperator expression]

atom

pair

unaryoperator expression

numberliteral

dateliteral

timeliteral

stringliteral

setliteral

variable

function

unaryoperator

!

not

+

-

binaryoperator

^

*

/

+

-

<

<=

>

>=

!=

<>

=

and

&&

or

|

yunits

stringliteral

pair

(expression, expression)

(expression, )

( , expression)

see Pair

stringliteral

see String

numberliteral

see Number

dateliteral

see Date

timeliteral

see Time

setliteral

{ [setexpr [,setexpr]... ] }

see Set

setexpr

expression

expression:expression[:expression]

expression;expression

variable

[_a-z][a-z0-9]

see Variables

function

[_a-z][a-z0-9] ( [parameterlist] )

see Functions

parameterlist

expression[, parameterlist]