# Data cleansing

Cleaning, fixing and preparing your data is crucial for success when using the Platform activation capabilities.\
The no-code approach allows you to create transformations using simple formula based on basic [functions ](https://doc.commandersact.com/features/data-quality/data-cleansing/supported-transformation-functions)and operators.

<figure><img src="https://1259070148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk6XpTQ2LaRLcr2tA-d%2Fuploads%2Fgit-blob-dd120a4f2211b1aae2fc68a1e664607f6e5307fa%2Fimage%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

You can choose between different kind of transformations:

* Rename event: simply change the name of an incoming event
* Derive event: create a new event from an existing one <mark style="color:blue;background-color:blue;">(c</mark><mark style="color:blue;">oming soon)</mark>
* Modify properties: apply transformations and functions on properties
* Filter event: define rules to filter incoming events <mark style="color:blue;background-color:blue;">(c</mark><mark style="color:blue;">oming soon)</mark>
* Custom code: create your own transformations <mark style="color:blue;background-color:blue;">(c</mark><mark style="color:blue;">oming soon)</mark>

## Rename event

<figure><img src="https://1259070148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk6XpTQ2LaRLcr2tA-d%2Fuploads%2Fgit-blob-49af50e8b9b95ab7112ddd0de77b5ac870bf3888%2FCapture%20d%E2%80%99e%CC%81cran%202022-12-08%20a%CC%80%2011.25.19.png?alt=media" alt=""><figcaption></figcaption></figure>

First, give a name to the transformation and add a description if needed.

Select on which sources the rename transformation will be applied.

Select which event should be renamed. It is also possible to add more conditions, like rename the page view event to product view, if 'page\_type' contains 'product'.

Last step, enter the new event name.

## Modify properties

First, give a name to the transformation and add a description if needed.

Select on which sources the transformation will be applied.

Define conditions on events and/or properties, the transformation will be applied only regarding these conditions.

{% hint style="success" %}
You can add multiple values (like event name is `purchase` ; `add to cart`). In that case, it is an OR condition (event name is `purchase` OR `add to cart`)
{% endhint %}

Select properties to transform. You can:

* rename the property ('rename to' option)
  * Example: rename 'date\_of\_birth' to 'birthdate'
* map/link to an existing property ('copy value from' option)
  * Example: map property 'price' to 'revenue'
* delete a property ('delete' option)
  * Example: always remove property 'tax\_amount' from event 'purchase'
* change the value ('set value to' option)

With the 'set value to' option, you can simply change the value (ex: 'currency' = EUR by default) but you also have access to formulas based on basic [functions](https://doc.commandersact.com/features/data-quality/data-cleansing/supported-transformation-functions) and operators.\
For example, you can hash incoming data with `SHA-256` or `MD5` functions. You can also `REPLACE` or `SUBSTITUTE` a text to replace by another one, or `EXTRACT` a specific text in a chain.

You can also use operators like `AND / OR / NOT` and create operations with `* / + -`, full list [here](https://community.commandersact.com/platform-x/features/data-quality/data-cleansing/supported-transformation-functions#operators).

For example, to calculate the revenue with taxes, you can do: `revenue = value*1,2`.

<figure><img src="https://1259070148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk6XpTQ2LaRLcr2tA-d%2Fuploads%2Fgit-blob-eb4c41d7e9af127ed58e12d24156b6117ba715ab%2FLive%20Normalization%20%5BREADY%5D%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>
