# Data mapping - cfxdm - dm:map

**dm:map:** This tag allows the user to manipulate or transform the columns and their values.&#x20;

Below are some of the operations you can perform using this tag.

* Copy the Column X along with its values as is and create a new Column Y
* Transform values from a Column to something else using 'functions' based on the user's requirement

**dm: map syntax:**&#x20;

* **dm:map from = '*****COLUMN\_X*****' & to = '*****COLUMN\_Y*****'**

OR

* **dm:map attr = '*****COLUMN\_Y' &*****&#x20;func&#x20;*****= "\<function-name>"  & \<argument syntax>***

Following two data CSV files are used to explain dm: map functionality

**Step 1**:&#x20;

Download the "[surveys.csv](https://macaw-amer.s3.amazonaws.com/rda/data/surveys.csv)" file to the local machine as shown below using a standard web browser.\
Download the [incidents.csv](https://macaw-amer.s3.amazonaws.com/rda/data/incidents.csv) file to the local machine as shown below using a standard web browser.

![](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-M_x4pRsoLgzzee_CiLZ%2F-M_x4sZ7UOPhSWH-a2bm%2FScreen%20Shot%202021-05-17%20at%206.29.20%20PM.png?alt=media\&token=48fb15fb-a27f-4b7f-85d4-5a7335c06195)

**Step 2**:  Upload (load) the above file into your RDA system as shown below.

* Using a web browser, connect to the RDA system \<https\://\<rda-ipaddress>:9998>
* Click on the CFXDX Python 3 icon from the main landing page of the RDA launcher (as shown below)&#x20;

![](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-M_x5GBDwa50nhLtIouP%2F-M_x5Sc0C1-2QjcfMEsl%2Fimage.png?alt=media\&token=0860c211-7062-45f6-b2b4-5583f910acca)

* Launch AIOps studio using the RDA provided text field to start AIOps studio.

![](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-M_x5kFub2fJ90wpLU7u%2F-M_x5o_GvIsotp1GQDyi%2Fimage.png?alt=media\&token=f84aa042-a6ed-4d40-9c1e-8161c953cc37)

Select the files and upload them into the studio environment (as shown below).

![Select the two downloaded files locally to a folder.](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-M_x62Hkk8jd6oDbu3qr%2F-M_x7oxqlBkQgx1qUKo0%2FScreen%20Shot%202021-05-17%20at%206.41.59%20PM.png?alt=media\&token=4f71ed84-0296-4acb-843c-c570f8aa3934)

![Uploaded files into AIOps studio](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-M_x7zO0ziqz2cgbob6Y%2F-M_x8rW8tx8leok1XWEq%2FScreen%20Shot%202021-05-17%20at%206.46.38%20PM.png?alt=media\&token=92af4bde-e3ee-4bbd-a551-881bcd1e39cc)

### **Example 1:** Clone the Column (copy)

This section explains two scenarios :\
1\. Creating a dataset from surveys.csv and incidents.csv files and create pipelines using AIOps studio functionality\
2\. Get the data from each dataset which includes some of the columns, **clone** the column X to column Y\
3\. Execute the pipeline.

### **Example 1a: Column names from surveys.csv file:**

* record\_id
* plot\_id
* length
* date etc

Step 1:  \
Create and add the following pipeline code/commands into the pipeline text field.

You can copy the below code into your pipeline and execute that in your AIOps environment.\
\&#xNAN;*`##### This pipeline loads surveys.csv file into AIOps studio stores the data loaded from ##### surveys.csv file into local dataset named 'cfxdm-map-clone-column'. Once`* \
*`##### the data is saved in 'cfxdm-map-clone-column' dataset, RDA functionality`* \
*`##### '@dm:map' is used to clone columns/names from the complete dataset that`* \
*`##### was read from csv file and rename those with user defined names as follows.`*\
\
*`@files:loadfile filename = "surveys.csv"`*\
*`--> @dm:save name = 'cfxdm-map-clone-column'`*\
*`--> @dm:map from = 'record_id' & to = 'Survey_record_id'`*\
*`--> @dm:map from = 'sex' & to = 'Gender'`*

Step 2: \
Verify the above pipeline code using the 'Verify' button and execute the pipeline (as shown below)

![Verify the pipeline code ](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-M_xEJTgtf44sWdtTo1z%2F-M_xEZ6CncuN2B-I_Ygt%2FScreen%20Shot%202021-05-17%20at%207.11.35%20PM.png?alt=media\&token=b8e863e5-622e-4aad-a824-7ed0745c4dd3)

![Execute the pipeline](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-M_xElXe1IN68q4Bfy1Y%2F-M_xF1KQks5gCiENP9aP%2FScreen%20Shot%202021-05-17%20at%207.13.39%20PM.png?alt=media\&token=c42a0c8b-4695-4463-abe0-d727641f4ed7)

Step 3:\
Once execution is completed, verify that the 'dm: map' cloned a column as expected (as shown below).

![After pipeline execution, dm: map columns are cloned to 'Gender', 'Survey\_record\_id'](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-M_xG8F6WiwbdG6GIsLk%2F-M_xGAXk129uE_oIDHbT%2FScreen%20Shot%202021-05-17%20at%207.18.28%20PM.png?alt=media\&token=82476543-2e61-4f69-b64c-796b608fcf20)
