# cfxdm - dm:bin

**dm:bin:** This cfxdm tag allows the user to group the numerical data into different bins,

**What is data binning ?** : Binning is a way to group numbers that are continuous values into a smaller number groups which are called as "bins". For example, if you have data about a group of people, you might want to arrange their ages into a smaller number of age groups. (5-15 years, 20-35 years, 45-65 years etc..)

**dm:bin** synta&#x78;**:**

* **column** (mandatory): Column name which has numerical values
* **bins** (mandatory): comma separated numerical range values

In the below example, for a reference, we are going to use **VMware vCenter** as an extension to query the data from VMs tag and their disk size.

Enter the below command to select **VMware vCenter VMs tag (\*vcenter:vms**). (In this example, **vcenter** name is used as a label to identify VMware vCenter extension and it's tags. The label is defined while adding the extension in cfxdx configuration file or through UI)

```
tag *vcenter:vms
```

![](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-MW6k3BIp5fTzyOAvOyx%2F-MW6us2YRudI68Vogt0D%2FScreen%20Shot%202021-03-18%20at%205.38.20%20PM.png?alt=media\&token=adbaa1e5-491d-4e2f-8086-1881695dc6fd)

**Example-1:**

Get VM's list and limit the ouput to VM's Name, Disk Size in KB and VM's BIOS UUID and save it as named dataset. (vm-disk-size)

```
data * get name as 'vm_name',disk_capacity_KB as 'disk_capacity_kb',id as 'bios_uuid' --> dm:save name = 'vm-disk-size'
```

Recall the named dataset (vm-disk-size) and convert the disk size to MB. (use [**dm:recall**](https://docs.cloudfabrix.io/rda/rda-userguide/rda-data-management-cfxdm/cfxdx-dm-recall) tag for the below query)

```
data name = 'vm-disk-size' -->  dm:map attr = 'disk_capacity_kb' & func = 'evaluate' & expr = "disk_capacity_kb / 1024"
```

Create the '**bins**' for VM's disk size which fall between 40000,75000,100000,150000,200000 MB in size.  (use [**dm:recall**](https://docs.cloudfabrix.io/rda/rda-userguide/rda-data-management-cfxdm/cfxdx-dm-recall) tag for the below query)

```
data name = 'vm-disk-size' -->  dm:map attr = 'disk_capacity_kb' & func = 'evaluate' & expr = "disk_capacity_kb / 1024" --> dm:bin column = 'disk_capacity_kb' & bins = '40000,75000,100000,150000,200000'
```

![](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-MW6k3BIp5fTzyOAvOyx%2F-MW6wbX6sBI7Q2zmvEl1%2FScreen%20Shot%202021-03-18%20at%205.46.05%20PM.png?alt=media\&token=a859d596-2936-40a2-acf6-1b5ae30156f3)
