Documentation

Cross Datasource Metric

In datapine, you can easily create customized fields from multiple data sources. Let’s assume you have one table containing your product prices and a second one containing the amount of products sold. By using the metric builder you can easily create a metric such as your revenue.

 

Before building cross datasource metrics, make sure your data sources are linked to each other by using Foreign Keys. For more information on how to join two data sources, please click here.

 

visualization showing how to create a cross database metric with datapine's metric builder

 

  1. In the Chart Creator, open the metric builder with a click on the metric icon in the toolbar and assign a name to your metric.
  2. To create a cross-database metric simply drag and drop the desired fields from your data sources on the left into the Formula Editor. In the Formula Editor, the data source name of the field will be displayed right below the field’s name.
  3. For each field select  and apply the aggregation type on the right of the screen. In our example, we’ve decided to take the count of sold products (ProductID) and the average product unit price (Unit_price).
  4. To enhance your metric with mathematical calculations use the number pad or type directly into the formula editor. In the example above, we’ve added a multiplication of these two fields.
  5. Save your metric as a new field by creating a folder or selecting an existing folder from the dropdown menu and then click on Save.

Your custom field can now be found in the selected metric folder under the data sources dropdown menu. Metrics can now be used like any other field to build your charts and graphs.