Skip to main content

Setting up the dev_payments model

First off, we'll start by setting up a couple of dev models, as we saw in the About the Sample Project section.

The source table

The source table for the dev_payments model is the raw.raw_payments table, which has the following columns:

img Raw Source Tables

Creating the dev_payments model

In the left panel of the Visitran UI, navigate to Models > No Code, right click on it and select New Model.

img New Model

This brings up a new model dialog.

img New Model

Let's name the model dev_payments and click on Create. This will create the model. Now, select that model from the left panel of the Visitran UI. This will bring up the model configuration dialog.

img Configure Dev Payments

  • Set the Heirarchy to Root model, which is the default
  • To configure the source, select the right schema and set the table to raw_payments
  • To configure the destination, select the right schema and set the table to dev_payments
  • Click on Apply. This will create the model.

The Transformations

We'll be creating two transformations on top of the source table:

  1. Rename the id column to payment_id
  2. Add a new column, amount_in_dollars, which is the amount column divided by 100

Let's see how to do this in Visitran in a no-code way.

1. Rename the id column to payment_id

In Visitran, we can rename a column by clicking on the column name in the data grid and typing the new column name, and saving the changes.

img Rename Column img Rename Column

Let's verify that the column has been renamed by looking for the renamed column indicator in the renamed column.

img Rename Column

Hovering over the renamed column indicator will show you the original column name.

2. Add a new column, amount_in_dollars

In Visitran, we can add a new column by clicking on the Add Column button. Adding a column is a fundamental way to transform data in Visitran. You can create new columns by using data from existing columns and transforming them using simple Excel-compatible formulas.

Let's add a new column, amount_in_dollars, which is the amount column divided by 100. Let's see how to do this in Visitran using the Excel-compatible formula QUOTIENT().

img Add Column

Let's verify that the column has been added by looking for the new column in the data grid.

img Add Column

Done with the dev_payments model

We've successfully set up the dev_payments model in Visitran. We've renamed the id column to payment_id. While all columns have a type indicator icon, renamed columns have a renamed column indicator, as you can see in the above screenshot for the payment_id column.

We've also added a new column, amount_in_dollars using a simple Excel-compatible formula. All new added columns are shown in purple.