# AI Match Transformation

Astera Data Stack introduces an innovative AI Matching feature which leverages the power of Artificial Intelligence to perform intelligent matching. This feature works based on semantic similarity, ensuring more accurate and comprehensive matching results.

### AI Match in Astera Data Stack

In Astera Data Stack, the *AI Match* object can be found in the Toolbox and can be used within the scope of the Dataflow.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FehzgUCWnsIvTdGVKEwBC%2F0.png?alt=media)

### Use Case

For our use case, we have a Customers dataset from the sales department as shown below:

<figure><img src="https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FLGrm2st39ZOoa8xCortf%2F1.png?alt=media" alt=""><figcaption><p>Sales Dataset</p></figcaption></figure>

We want to replace the values in the Country column of the sales dataset by semantically matching them with Country values from the Customers dataset provided by the marketing team, ensuring both departments follow a unified naming standard.

<figure><img src="https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FS5Ba1SNe5zjf4bR3jXbf%2F2.png?alt=media" alt=""><figcaption><p>Marketing Dataset</p></figcaption></figure>

1. To get started, let’s drag-and-drop an *Excel Workbook Source* object and configure it with the customers dataset provided by the sales department.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FgU59KRln46wkuRcEd6ew%2F3.png?alt=media)

2. Next, drag-and-drop the *AI Match* object from the Toolbox onto the Dataflow and auto-map the fields from the *Excel Workbook Source* onto the *AI Match* object.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2F5hvnHpHAoDp2hNeOjJWh%2F4.gif?alt=media)

3. Once all the fields have been mapped, right-click on the *AI Match* object and select *Properties* from the context menu.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FEN4hXKjj3R8sbvsvWpPN%2F5.png?alt=media)

4. This will open the Layout Builder screen, which shows the layout of the incoming dataset. Click *Next.*

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2F9ixTZbwotDEg1ZnIb16D%2F6.png?alt=media)

5. The *AIMatch Transformation Properties* screen will open, let’s configure these properties.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FblGfYY1n1QRE5tiFcX9g%2F7.png?alt=media)

* *File Path:* This is where we provide the path of the file on the basis of which we want to perform our semantic matching.
* *Worksheet:* This is where we can define which Excel sheet data to use if there are multiple sheets.
* *Lookup Field:* This is the field based on which we are performing the lookup.
* *Incoming Field:* This lets us define the lookup field from the incoming dataset

For our use case, let’s select the *Country* Field for both.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FoNW0wzN3zFVj43Bu9g5z%2F8.png?alt=media)

6. Once done, click *OK* and right-click on the *AI Match* object to preview its output.

As you can see below, the values in the *Country* field have been semantically matched and replaced from the file, using AI. We can also see that, since the country Pakistan did not have a matching field in the marketing dataset, it hasn’t been replaced.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2F60ydrGxvVwHnfpyldQgu%2F9.png?alt=media)

7. Now, let’s drag-and-drop a *Database Table Destination* object and map the matched data onto it.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FPgYNao4iXQaziXsYMcs6%2F10.png?alt=media)

Running this Dataflow will write the data to the destination table.

This concludes the working of the *AI Match* object in Astera Data Stack.
