*Counts the number of datapoints that have been seen.*

Count represents the total number of datapoints passed through the transform. It is equivalent to an `i`

used in a loop over an array, with the difference that count starts from 1, rather than 0.

No matter what the datapoints, the sequence of data that count returns is:

```
1,2,3,4,5...
```

Suppose you want to count the number of times you were in a great mood:

```
if $ >= 8 | count | if last
```

The above transform will return only the datapoints where your mood rating was 8 or above, it will count them, and only return the last datapoint (which contains the full count).

Suppose you want to find how many times you visited a friend:

```
if distance(<latitude>,<longitude>) < 50 | if changed | if $ | count | if last
```

The above transform finds when you were within 50 meters of the given coordinates (your friend’s home), filters these datapoints so only changes remain (so each time you visit, you get one `true`

, followed by a `false`

when you leave), filter the false values, and count the number of times you visited. Note that `if $ | count`

can be replaced with `sum`

in this case.

Now you want to see which weekdays you use your computer the most. You can simply count the datapoints in your laptop’s stream to see what days have most data:

```
map(weekday,count)
```

One-To-One | Stateless | Peek | Input Schema | Output Schema |
---|---|---|---|---|

True | False | False | {"type": "integer","minimum": 0} |