Creating a custom column

Let’s start with a simple example. Let’s say our Payments column is formatted in cents. Rather than having to divide it by 100 every time we want a dollar amount, we’ll create a calculated column to do this for us.

We’ll navigate to our data source settings, and switch to the Schema tab. We want our column to be in the Payments table, so we’ll scroll down to find this table, expand it, and click the Add Custom Column button.

Click Add Custom Column under a table within your database schema

Custom column settings

  • Grouping
    If you’re creating a category or other groupable value, choose Dimension. If your value is numeric, choose Measure.

  • Aggregated
    If you are aggregating a measure, such as taking a count or an average, select the Aggregated checkbox.

  • Type
    Select the data type of your column. Note: this does not convert your column to the specified data type, it simply tells Chartio how the column can be used. To convert your column data type, use database-specific syntax in the custom column query.

In the pop-up modal, we’ll set our new column settings and add our SQL as shown below. When finished, click Add Column.

Define your column using SQL