Avenue Launches Data Enrichment: Use Multiple Data Sources for Alerting

Caren Duane
March 9, 2023

Avenue users can now build one monitor that is triggered by multiple data sources.

What is Data Enrichment?

Data enrichment is a process that involves combining first-party data collected from internal sources (such as subscriber forms) with data collected from other internal sources or third-party external sources.

Why is it useful?

This feature is useful when you need to join data from more than one source. For example, if you had customer data in one data warehouse (like Snowflake or Redshift) and you wanted to join to outbound email data (from Front or Customer.IO). This feature is helpful for companies whose data sits across more than 1 database.

How it works?

  1. In the Monitors view, add a new database and write sql query

  2. Select the columns that you want to relate between databases (note: the fields you seek to join must contain identical values)

Examples:

1. A business collects data from a wifi device that is stored in their data warehouse, while their onboarding and customer data are saved in a separate database. By utilizing the multi-data source feature, they can seamlessly merge data from both sources and gain deeper insights.

2. Another organization has real-time data stored in their postgres microservices, but broader store information is saved in Snowflake. By integrating data from both sources, they can gain a more complete view of their business operations and make informed decisions.

3. A ride-sharing company stores device data in Presto and driver information in Hive. By leveraging the multi-data source feature, they can merge data from both sources to obtain a more comprehensive picture of their business.

Using Handlebars 

To make it easier to ask for specific information, you can use the handlebars syntax in the enrich sql. Handlebars helps you organize your data so you can find what you're looking for more easily. When you use handlebars, the data is put into a context variable which contains all of the rows of information from your other query. This variable organizes the information so it's easier for you to read and understand.

To access a value in the first row, you can use the Handlebars syntax in the SQL Query for the enriching database. The syntax would be {{ data.[0].column1 }}. The data variable contains all the rows of information from the other query and is organized using context variables. By using this syntax, you can easily retrieve the value of column1 in the first row of data from the enriching database.

Let’s assume that the original query returned the following results:

If you wish to select rows in the enrichment query based on matching id and originalId values, you can achieve this with the following approach:
This query will help you retrieve all rows of information from a table in a database called "EnrichmentTable" that match a specific criteria. The criteria is based on whether the id value in each row matches any of the originalId values in a list of data.


Which handlebars would then compile into:


Head of BizOps