When you open a map, the Layers tab will appear on the left side panel. There you can add data as layers to the map by clicking on “Add source from”, where you can access the contents from your existing data warehouse connections. If you haven’t added a data layer to the map yet, you will see the following page:
Add source from a connection
From the Layers tab, go to the Sources panel and click on Add source from…. A new dialog screen will open allowing you to select a table or a tileset from on of your connections. Insert the Fully Qualified Table or the Tileset Name and click Add source.
Once the process is finished, the table or tileset is included in the Builder map as a new layer. The map displays the basemap and the new layer on top. You can add additional layers, or start applying styling and analysis features.
Once you have added your datasets to the map, you can visualize the data table. Click on the three dots icon, select Show data table and your dataset table will be displayed.
By clicking the tree dots icon the Column Context menu will reveal additional options such as: Sort on this column, ascending or descending, Pin the column so you can freeze it in the first position, and copy column data.
Once you have added your datasets to the map, you can always add a new layer or delete the source. Click on the three dots icon and select Add layer or Delete source.
Add source from a custom query
Go to Sources and click Add source from…. A new dialog screen will open allowing you to create your own query or run a SQL analysis to data on your connection. Select an option and click Add source.
Once the process is finished, the SQL console appears in the Builder interface, where you can type your query and then click Run. Please make sure to use Fully Qualified Table names.
In this example we are going to use a table accessible via a BigQuery connection. The BigQuery table is included in the Builder map tool as a new layer. You can add additional layers, or apply styling and analysis features.
Custom queries using the Analytics Toolbox
You can also use the Analytics Toolbox functions in your custom SQL queries. For example, you can perform a simple clustering using the
ST_CLUSTERKMEANS function by running this query from your CARTO Data Warehouse connection:
This query computes five clusters from the points of the
sample_customer_home_locations table. As a result, each point is assigned a
cluster ID. By styling the layer by this
cluster attribute, we get the following result: