# More downsampling woes

**URL:** <https://community.influxdata.com/t/more-downsampling-woes/25145>\
**Category:** InfluxDB 2\
**Created:** [May 24, 2022, 7:37am UTC](https://community.influxdata.com/t/more-downsampling-woes/25145 "2022-05-24T07:37:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hugh\_Barnard](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/hugh_barnard/32/9999_2.png) [@Hugh\_Barnard](https://community.influxdata.com/u/Hugh_Barnard)\
**Post date:** [May 24, 2022, 7:37am UTC](https://community.influxdata.com/t/more-downsampling-woes/25145/1 "2022-05-24T07:37:45Z")

</div>

I need to do something, very similar to this:  
https://stackoverflow.com/questions/36209516/how-do-i-group-by-count-of-a-field-in-influxdb with Flux rather than 1.x series. My (clearly wrong!) pseudo code is:

```auto
data =
    from(bucket: "probe_box")
        |> range(start: -duration(v: int(v: task.every) * 2))
        |> filter(fn: (r) => r["mac_address"])
        |> count(mac_address)

data
    // Stores the aggregated data in a new bucket
    |> to(bucket: "probe-downsampled", org: "uni")

```

Do I need to use windowAggregate? I suspect a few other people, apart from the above need to do this too?

TIA Hugh
