Skip to main content
All CollectionsNeuron AppTransforms and metrics
Counting data points that match a condition
Counting data points that match a condition

Transforms and metrics

José Mariano Porras avatar
Written by José Mariano Porras
Updated over a year ago

Neuron allows us to use comparison functions and sum() aggregation function to count the number of data points for which a condition is true.

To count data points that match a condition:

  1. Create a transform that uses a comparison function to define a filter condition on another property.

  2. Create a metric that sums the data points where that condition is met.

Example: counting the number of data points where water is boiling

Consider a scenario where you have a measurement, temp , that provides the temperature (in Celsius) of water in a machine.

You can define the following transform and metric properties to count the number of data points where the water is boiling:

  • Transform: is_boiling = gte(temp_c, 100) – Returns 1 if the temperature is greater than or equal to 100 degrees Celsius, otherwise returns 0 .

  • Metric: boiling_count = sum(is_boiling) – Returns the number of data points where water is boiling.

Did this answer your question?