# Lookup

In this document, you’ll learn how to use the *Lookup* transformation in Astera Dataprep to enrich a dataset by bringing in additional fields from another source.

### Use Case

A university maintains a student's dataset, but roll numbers are stored separately. To prepare data for reporting and transcripts, the university needs to enrich the student's dataset with roll numbers, ensuring each student is matched correctly.&#x20;

This lookup source may exist as a file, a shared project source or in a database table.&#x20;

1. In the toolbar, click on *Lookup* and select the appropriate source type.
2. This will open the *Recipe Configuration – Lookup* panel. In this panel you can configure the source-specific settings (see tabs below).

{% tabs %}
{% tab title="File " %}

<figure><img src="https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2FZQChRJFKroG6j0gwjoi4%2Fimage.png?alt=media&#x26;token=d7d5f042-cc6a-48b9-b5fe-04404cad111b" alt="" width="431"><figcaption></figcaption></figure>

* **Browse Path**: Use this to manually browse and select your source file.
* **Path from Variable**: Use this when your file path is dynamic and parameterized. To learn more about using variables click [here](https://documentation.astera.com/variables#using-variables-in-recipes).

For this use case, we’ll use the *Browse Path* option.

<figure><img src="https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2Fs0NJpd96jYvRyjihWuef%2Fimage.png?alt=media&#x26;token=cb1d325e-bf37-4b29-89ab-894edba27146" alt="" width="429"><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Project Source" %}

* **Lookup Source:** Choose the source you want to use for your Lookup. All available sources will be visible in the drop-down.

<figure><img src="https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2FcW5bEJNvQDFChs9rjhHu%2FGroup%2013.png?alt=media&#x26;token=fdfbe3e3-1cea-4116-a7ca-1ad2ae8d6c6c" alt="" width="388"><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Database Table" %}

* **Connection Name:** Select the shared connection you want to use. The drop-down lists all shared connections available in the project.

<figure><img src="https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2FWs0AL1Vq0YIuKYh1ePhr%2Fimage.png?alt=media&#x26;token=3e78bd45-9514-434c-a090-bc6585168ef4" alt="" width="428"><figcaption></figcaption></figure>

* **Table:** From the drop-down, choose the database table you want to lookup from with. In this example, we’ll select the *RollNo* table.

<figure><img src="https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2FtWWQtddjwOxGrIi1GElM%2Fimage.png?alt=media&#x26;token=527755d9-3c55-4422-a60d-52d63eaf733a" alt="" width="433"><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

* Provide a name for the lookup dataset (or keep the default name).

<figure><img src="https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2FIdCtgzbilIT4DxwPIntw%2Fimage.png?alt=media&#x26;token=8fc71983-2348-4cc3-957b-bccf6757100d" alt="" width="346"><figcaption></figcaption></figure>

* **Keys:** Select the key fields to define how records will be matched. Astera will auto-detect matching fields, but you can modify them as needed.

  <figure><img src="https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2Fn8wTYW1X1gvUyVi1IP3R%2Fimage.png?alt=media&#x26;token=bbde4983-b671-4153-96f2-1c8f02cb7d27" alt="" width="391"><figcaption></figcaption></figure>

  * **Current Dataset Column**: Field from the current dataset.
  * **Source Column**: Field from the lookup dataset.
* **Return Columns:** Choose which columns to return from the lookup source.

<figure><img src="https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2FF6J3LwMFyeMJBxtR1Myc%2Fimage.png?alt=media&#x26;token=9f46bd8f-2c53-4bcf-8ba2-e537b1b0b4d0" alt="" width="394"><figcaption></figcaption></figure>

3. Once you’re done, click <img src="https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2FfwyZNpWvhrViOhk9TmRY%2F7.png?alt=media" alt="" data-size="line"> *Apply.* The result will appear in the grid with the new column(s) added.

<figure><img src="https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2FUw2Lay96F9xSOnSsjj96%2Fimage.png?alt=media&#x26;token=41b135e5-df9e-4c8a-a452-bcbf3d9f6c56" alt=""><figcaption></figcaption></figure>
