# What Metrics can I measure with Cohort

## Here is the list of metric types available and their definition.

#### Percentage of time where

This takes a Filter as an argument, and calculates the:

Device time where the expression is true / Sum of device time

It is most commonly used to calculate uptime %.

#### Count devices where

This takes a Filter as an argument, and counts the number of devices where the expression is ever true.

Example - if we wanted to know the number of devices that got into a low battery condition, we could ask:

Count devices where Battery < 20%

And it would display the number of devices that had ever had low battery, in the time range specified.

#### Percentage of devices where

This takes a Filter as an argument, and counts the percentage of devices where the expression is ever true.

Percentage of devices where Battery < 20%

And it would display the number of devices that had ever had low battery / total number of devices seen, in the time range specified.

#### Mean value of

This takes a property as an argument, and calculates the arithmetic mean - the sum divided by the count.

#### Mode value of

This takes a property as an argument, and calculates the mode - the most frequent value.

#### Median value of

This takes a property as an argument, and calculates the median - the middle of the sorted values.

#### Count of

This takes a property as an argument, and calculates the count- the number of occurrences.

#### Sum of

This takes a property as an argument, and calculates the sum - the total value.

#### Minimum value of

This takes a property as an argument, and calculates the minimum - the lowest value.

#### Maximum value of

This takes a property as an argument, and calculates the maximum - the most highest value.

#### Count distinct values of

This takes a property as an argument, and calculates the number of unique values in the data. Using \$id as a property can be used to count unique devices, for instance.

#### Percentage of time in each value of

This takes a property as an argument, and calculates the time spent in each unique value of the property. This is particularly useful if your device reports a state property (i.e. heating/not heating, charging/post-charge/occupied etc). You can then easily calculate how much time your devices spend in each state.