# Grouping the Vehicle\_Speed by BCM\_Commandmodes(Dont have any Tags in Measurements)

**URL:** https://community.influxdata.com/t/grouping-the-vehicle-speed-by-bcm-commandmodes-dont-have-any-tags-in-measurements/30346
**Category:** Tasks
**Tags:** flux
**Created:** [June 19, 2023, 6:03am UTC](https://community.influxdata.com/t/grouping-the-vehicle-speed-by-bcm-commandmodes-dont-have-any-tags-in-measurements/30346 "2023-06-19T06:03:29Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![nagashree](https://avatars.discourse-cdn.com/v4/letter/n/71e660/32.png) [@nagashree](https://community.influxdata.com/u/nagashree)
#### Post date: [June 19, 2023, 6:03am UTC](https://community.influxdata.com/t/grouping-the-vehicle-speed-by-bcm-commandmodes-dont-have-any-tags-in-measurements/30346/1 "2023-06-19T06:03:29Z")

</div>

This is the query i have written but not getting the Proper graph For this.  
import “experimental”

from(bucket: “Grafana\_Bucket”)  
|\> range(start: v.timeRangeStart, stop: v.timeRangeStop)  
|\> filter(fn: (r) =\> r.\_measurement == “MAY\_4\_New \_Regen\_Switch\_logic\_V24\_fixed\_portable”)  
|\> filter(fn: (r) =\> r.\_field == “Vehicle\_Speed” or r.\_field == “BCM\_ModeCommand”)  
|\> max(column: “\_value”)  
|\> map(fn: (r) =\> ({  
\_time: r.\_time,  
\_field: if r.\_field == “BCM\_ModeCommand” then  
if r.\_value == 1.0 then “Sonic”  
else if r.\_value == 2.0 then “Ride”  
else if r.\_value == 3.0 then “Dash”  
else “Eco”  
else r.\_field,  
\_value: r.\_value  
}))  
|\> group(columns: [“\_field”])  
|\> yield(name: “max\_speed”) **i am using this query but not getting proper graph**

 ![image](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/d/df62227d48d6a6a6a353faa3906f3ec23e32ce67.png)  
How to get the proper Grapgh for all command modes which is grouped by vehicle\_speed
