# Create Transformations

## How to create Transformations

\====================================

[Click here to watch](https://app.guidde.com/share/playbooks/2ffNjs3Qg22dEU9rh2EKDg)

#### 1. Click "Transformations"

Access the Transformations feature.

![Click 'Transformations'](https://static.guidde.com/v0/qg%2FraLWLclW5xaCFqOvIqCjB9MgofQ2%2F2ffNjs3Qg22dEU9rh2EKDg%2F194YtHB3tPwxwk7KCC5Dfi_doc.png?alt=media\&token=2ba5e140-558b-412b-a08f-397b0bed9569)

#### 2. Create a New Model

Models are a meant to represent a grouping of logical transformation schema

![Create a New Model](https://static.guidde.com/v0/qg%2FraLWLclW5xaCFqOvIqCjB9MgofQ2%2F2ffNjs3Qg22dEU9rh2EKDg%2FoMdeReoLpV2xkxRUfTxUFw_doc.png?alt=media\&token=3ebdc11f-24d4-4a60-a964-a57b6a6d850a)

#### 3. Enter a unique name to identify your model and click "Create"

Finalize the creation by clicking "Create".

![Enter a unique name to identify your model and click 'Create'](https://static.guidde.com/v0/qg%2FraLWLclW5xaCFqOvIqCjB9MgofQ2%2F2ffNjs3Qg22dEU9rh2EKDg%2FvAZ1RVTi4AXNbfaAZVkvx3_doc.png?alt=media\&token=865d6e6c-c2e7-4e12-9375-642c907863d5)

#### 4. You should now be able to see the newly created model

Click the model to see all the transformations within it

![You should now be able to see the newly created model. Click the model to see all the transformations within it](https://static.guidde.com/v0/qg%2FraLWLclW5xaCFqOvIqCjB9MgofQ2%2F2ffNjs3Qg22dEU9rh2EKDg%2FruJm3V1u4vMv8hHbTpbGiz_doc.png?alt=media\&token=da9fdafa-c624-476f-b217-71d0a54f46c3)

#### 5. Once clicked, you should see all the transformations within the model

In this situation, we haven't created any transformations so it will be empty

![Once clicked, you should see all the transformations within the model](https://static.guidde.com/v0/qg%2FraLWLclW5xaCFqOvIqCjB9MgofQ2%2F2ffNjs3Qg22dEU9rh2EKDg%2FvHjXrxMdKVo16g8JCTf7vZ_doc.png?alt=media\&token=6c4ae25b-219d-4324-ad2f-395768ef4cf9)

#### 6. Click "New Transformation" to create a new transformation within the model

Click "New Transformation" to create a new transformation within the model

![Click 'New Transformation' to create a new transformation within the model](https://static.guidde.com/v0/qg%2FraLWLclW5xaCFqOvIqCjB9MgofQ2%2F2ffNjs3Qg22dEU9rh2EKDg%2F7VGL3qp538AHENaZrjJueu_doc.png?alt=media\&token=83387e00-4629-475c-9a44-10d8b732b0db)

#### 7. You should see a list of all eligible source connections and transformations on the left hand side of the page

At the moment, only PostgreSQL and MySQL are supported but we will add support for other sources soon

![You should see a list of all eligible source connections and transformations on the left hand side of the page](https://static.guidde.com/v0/qg%2FraLWLclW5xaCFqOvIqCjB9MgofQ2%2F2ffNjs3Qg22dEU9rh2EKDg%2FfQD8NGPuhkaQCgHA5awqge_doc.png?alt=media\&token=29467aa7-f5f8-4613-b5f0-c407d9dba494)

#### 8. Enter a unique name for the transformation

In this example, we will name the transformation as "payments".

![Enter a unique name for the transformation](https://static.guidde.com/v0/qg%2FraLWLclW5xaCFqOvIqCjB9MgofQ2%2F2ffNjs3Qg22dEU9rh2EKDg%2FmVVxWbdJ6ttDdMn2H3TVsW_doc.png?alt=media\&token=7e232925-57c0-409c-a0d6-b60696d3bd7d)

#### 9. Type your SQL statement as a CTE

Type your SQL statement as a CTE. In order to reference a source connection, you MUST use the source designation e.g. {{ source('jaffleshop', 'payments') }}

![Type your SQL statement as a CTE](https://static.guidde.com/v0/qg%2FraLWLclW5xaCFqOvIqCjB9MgofQ2%2F2ffNjs3Qg22dEU9rh2EKDg%2FuSQSYiCLaznjh1AczcVcZu_doc.png?alt=media\&token=ad70db7f-6499-4b32-8168-3f572838eae2)

#### 10. Click "Compile" to run the query

Compile the transformation.

![Click 'Compile' to run the query](https://static.guidde.com/v0/qg%2FraLWLclW5xaCFqOvIqCjB9MgofQ2%2F2ffNjs3Qg22dEU9rh2EKDg%2F61QnUbbWVJ8KmB8adNhPHs_doc.png?alt=media\&token=2d879d49-a20c-49b2-8fa9-e1c4bc0c6085)

#### 11. Check the format of your results

If your SQL compilation is successful, you should see a preview of your results. Note: Context Data will only return 5 results to the view

![Check the format of your results](https://static.guidde.com/v0/qg%2FraLWLclW5xaCFqOvIqCjB9MgofQ2%2F2ffNjs3Qg22dEU9rh2EKDg%2F8odKLmnQQiRMLsbAPb87st_doc.png?alt=media\&token=da512707-87cf-409e-b67c-b039bdd964fa)

#### 12. You can add Description to explain what your transformation does (optional)

Provide a description for the transformation.

![You can add Description to explain what your transformation does (optional)](https://static.guidde.com/v0/qg%2FraLWLclW5xaCFqOvIqCjB9MgofQ2%2F2ffNjs3Qg22dEU9rh2EKDg%2F9Y6eyHSZLWRcmUUcXzqJTa_doc.png?alt=media\&token=34e09670-74a2-4c55-8299-96926dc1e7c9)

#### 13. Click "Save Transformation"

Save the transformation.

![Click 'Save Transformation'](https://static.guidde.com/v0/qg%2FraLWLclW5xaCFqOvIqCjB9MgofQ2%2F2ffNjs3Qg22dEU9rh2EKDg%2F8Xk1j2yk7YJwi2iaUqF7FF_doc.png?alt=media\&token=25c2e9ec-44d6-4c30-8d56-de3711c76298)

#### 14. You should be redirected back to the transformations page.

Click your model and should see the newly created model

![You should be redirected back to the transformations page. Click your model and should see the newly created model](https://static.guidde.com/v0/qg%2FraLWLclW5xaCFqOvIqCjB9MgofQ2%2F2ffNjs3Qg22dEU9rh2EKDg%2Fk3z9AHSAvY6LMKBrCmAtD4_doc.png?alt=media\&token=1e67716e-1378-461f-938d-e4a7ac5d6c88)

#### 15. You can create multiple transformations within your model

In this example, we will create another transformation

![You can create multiple transformations within your model](https://static.guidde.com/v0/qg%2FraLWLclW5xaCFqOvIqCjB9MgofQ2%2F2ffNjs3Qg22dEU9rh2EKDg%2F5m4JM2Es1NN96emkAmBHuV_doc.png?alt=media\&token=09c8af85-f85e-43f6-accb-1764c5c34735)

#### 16. We're going to create a new transformation called "orders"

Create a new transformation

![We're going to create a new transformation called 'orders'](https://static.guidde.com/v0/qg%2FraLWLclW5xaCFqOvIqCjB9MgofQ2%2F2ffNjs3Qg22dEU9rh2EKDg%2F9N7GyPeJMthSVt1mrbRvb5_doc.png?alt=media\&token=181df163-2f75-4111-9895-d430cb1df644)

#### 17. Enter the SQL query

Just the first transformation, we're going to enter the SQL query to create the transformation

![Enter the SQL query](https://static.guidde.com/v0/qg%2FraLWLclW5xaCFqOvIqCjB9MgofQ2%2F2ffNjs3Qg22dEU9rh2EKDg%2Fv3rzpSzHWfEyJCjNnP6m5r_doc.png?alt=media\&token=595ed1e0-2738-4b15-9a24-2e67759f42c2)

#### 18. Click "Compile"

Compile the transformation.

![Click 'Compile'](https://static.guidde.com/v0/qg%2FraLWLclW5xaCFqOvIqCjB9MgofQ2%2F2ffNjs3Qg22dEU9rh2EKDg%2FsWZYWYECVowifRR2naoLgX_doc.png?alt=media\&token=eb3414a8-250a-40ff-8f4e-78ebed8e2290)

#### 19. Click "Save Transformation"

If your SQL compilation is successful, you should now be able to save the transformation.

![Click 'Save Transformation'](https://static.guidde.com/v0/qg%2FraLWLclW5xaCFqOvIqCjB9MgofQ2%2F2ffNjs3Qg22dEU9rh2EKDg%2FfV7S5rqh7XvcFvMvqT8RGW_doc.png?alt=media\&token=5e6d471f-896f-4919-8829-6766235a60ca)

#### 20. If we click our model this time, we should see 2 transformations which includes the newly created "orders" transformation

View all transformations within the model

![If we click our model this time, we should see 2 transformations which includes the newly created 'orders' transformation](https://static.guidde.com/v0/qg%2FraLWLclW5xaCFqOvIqCjB9MgofQ2%2F2ffNjs3Qg22dEU9rh2EKDg%2FmzBurSB4vW2kBMbnZm2u41_doc.png?alt=media\&token=3cd823e2-d3b3-4260-a3bf-fb84bf1e911a)

#### 21. Let's create a dependent (downstream) transformation

In the previous examples, we created SQL transformations from source connection data. Now let's use these transformations to create another transformation

![Let's create a dependent (downstream) transformation](https://static.guidde.com/v0/qg%2FraLWLclW5xaCFqOvIqCjB9MgofQ2%2F2ffNjs3Qg22dEU9rh2EKDg%2FcPbfu2WZ5Krfs5ewK6oPEE_doc.png?alt=media\&token=429143a1-5964-4fb8-bdd1-829d84f6d5f1)

#### 22. Enter a transformation name. In this case, we will name this transformation as "customerpayments"

Name the transformation as "customerpayments".

![Enter a transformation name. In this case, we will name this transformation as 'customerpayments'](https://static.guidde.com/v0/qg%2FraLWLclW5xaCFqOvIqCjB9MgofQ2%2F2ffNjs3Qg22dEU9rh2EKDg%2Fe9WDSeV1bWrBsRVVopYDjb_doc.png?alt=media\&token=17fc0d76-8ebd-4198-b14c-1d1292f64b17)

#### 23. Enter the SQL statement for the downstream transformation

In order for us to reference a previously created transformation, make sure to use the ref designation e.g. {{ ref('jaffleshop', 'payments') }}. In this example, you can see that we are referencing both the previously created "payments" and "orders" transformation

![Enter the SQL statement for the downstream transformation](https://static.guidde.com/v0/qg%2FraLWLclW5xaCFqOvIqCjB9MgofQ2%2F2ffNjs3Qg22dEU9rh2EKDg%2FkUGgzdXc9u7mH9cgY3zKnn_doc.png?alt=media\&token=bcda88a6-67bf-4f0f-be9c-a748124066d4)

#### 24. Click "Compile"

Compile the transformation.

![Click 'Compile'](https://static.guidde.com/v0/qg%2FraLWLclW5xaCFqOvIqCjB9MgofQ2%2F2ffNjs3Qg22dEU9rh2EKDg%2Fr5QwHPAY9b6p6YNXSh5hxj_doc.png?alt=media\&token=125d8060-c5a9-42ad-949e-060b5d24a779)

Compile the transformations.

![Click 'Compile'](https://static.guidde.com/v0/qg%2FraLWLclW5xaCFqOvIqCjB9MgofQ2%2F2ffNjs3Qg22dEU9rh2EKDg%2F8PkiGbMciUnSwuTT74bDm2_doc.png?alt=media\&token=5871f8f6-7b0d-462b-b81b-f78f67b50d75)

#### 25. You should see that Context data correctly compiled the new SQL statement and correctly referenced the previously created transformations.

View results

![You should see that Context data correctly compiled the new SQL statement and correctly referenced the previously created transformations.](https://static.guidde.com/v0/qg%2FraLWLclW5xaCFqOvIqCjB9MgofQ2%2F2ffNjs3Qg22dEU9rh2EKDg%2F2GwrSYxxJUtQGNoyDTTNyL_doc.png?alt=media\&token=c1c7afc7-2443-41f6-bb54-a46b4751b5f9)

#### 26. We're going to add a description to this transformation

Describe the transformation.

![We're going to add a description to this transformation](https://static.guidde.com/v0/qg%2FraLWLclW5xaCFqOvIqCjB9MgofQ2%2F2ffNjs3Qg22dEU9rh2EKDg%2F4pvKrj7fExgxr3Bb91fPCK_doc.png?alt=media\&token=7d24964e-e9b8-4e24-bb51-6ab40eb7797c)

#### 27. Click "Save Transformation"

Save the transformation.

![Click 'Save Transformation'](https://static.guidde.com/v0/qg%2FraLWLclW5xaCFqOvIqCjB9MgofQ2%2F2ffNjs3Qg22dEU9rh2EKDg%2F3yFewxokEEZCJSzLm2LYXH_doc.png?alt=media\&token=0065fcf2-24c1-42eb-969b-23c2644cb0bd)

#### 28. If we click our model once more, we should see all transformations including the newly created transformation

View all created trasformations

![If we click our model once more, we should see all transformations including the newly created transformation](https://static.guidde.com/v0/qg%2FraLWLclW5xaCFqOvIqCjB9MgofQ2%2F2ffNjs3Qg22dEU9rh2EKDg%2Fr6naDjo1ZHMqvpDhQ58YZX_doc.png?alt=media\&token=0e068d33-4c84-4081-8956-286405a5db82)
