Function

public enum Function : String, Encodable

Sets the aggregation function.

All values from the linked target, corresponding to the same value in the groups array, are collected and reduced by this function. count is simply the number of values in the groups array, so does not even require the linked array to exist. first (last) is just the first (last) linked value. Invalid values are ignored, so for example in avg they do not contribute to either the numerator or the denominator. Any data type (numeric, date, category) may be aggregated with any function, even though in certain cases it is unlikely to make sense, for example a sum of dates or average of categories. median will return the average of the two central values if there is an even count. mode will return the first value to reach the maximum count, in case of a tie. change will return the difference between the first and last linked values. range will return the difference between the min and max linked values.

  • Undocumented

    Declaration

    Swift

    case count
  • sum

    Undocumented

    Declaration

    Swift

    case sum
  • avg

    Undocumented

    Declaration

    Swift

    case avg
  • Undocumented

    Declaration

    Swift

    case median
  • Undocumented

    Declaration

    Swift

    case mode
  • rms

    Undocumented

    Declaration

    Swift

    case rms
  • Undocumented

    Declaration

    Swift

    case stddev
  • min

    Undocumented

    Declaration

    Swift

    case min
  • max

    Undocumented

    Declaration

    Swift

    case max
  • Undocumented

    Declaration

    Swift

    case first
  • Undocumented

    Declaration

    Swift

    case last
  • Undocumented

    Declaration

    Swift

    case change
  • Undocumented

    Declaration

    Swift

    case range