Querying DataVault

DataVault is built on Redshift and has a similar query syntax to PostgreSQL. Most BI tools allow you to access databases through PostgreSQL. This should be sufficient to accessing your DataVault.

Business Intelligence (BI) Tools

Here are a few BI tools that are known to work with DataVault well. We also have partnerships with some of these companies. Please reach out to info@tenjin.io for any questions about the partnerships.

Get Started

Learning to write SQL can be a daunting challenge. Nonetheless, all marketers in the future will have this skill.

Tenjin has a many examples that make it easy to learn SQL and DataVault. As you get more comfortable, you can modify your queries and continue to optimize!

Learning SQL

A good place to learn the strict SQL syntax is here: https://www.w3schools.com/sql/sql_intro.asp

Key sections include:

  1. SELECT
  2. SELECT DISTINCT
  3. WHERE
  4. AND/OR/NOT
  5. ORDER BY
  6. JOIN, INNER JOIN

Using the above basics you can pull data tables that exist in DataVault and, with joins, bridge the data across tables.

Paired with the below examples from Tenjin, you should have enough to get comfortable with any optimization you'll need for marketing.

Tenjin's standard queries

Each query is written for DataVault and can be modified for your specific purposes.

Below is a sample query.

/* This is a query on how to calculate DAU keying off of advertising_id for your individual users.
@DATE => refers to to the date that you want to see DAU for.
@BUNDLEID => bundle_id for your app
@PLATFORM => platform of your app
*/

SELECT COUNT(DISTINCT coalesce(advertising_id, developer_device_id)) as dau
FROM events
WHERE created_at :: DATE = '@DATE'
  AND bundle_id = '@BUNDLEID'
  AND platform = '@PLATFORM';

The query calculates the daily active users (DAU) for a certain date. Without even knowing SQL you can sort of read what it is doing. But ignore the exact context for now - just know that it calculates DAU for a certain day.

As a beginner, you can just change all the variables with the @ symbol to get what you need.

In this case change the @DATE to the date you want to analyze, the @BUNDLEID to the bundle_id you are using, and @PLATFORM to the platform that you are looking at.

In the end you might modify the query to look something like this:

/* This is a query on how to calculate DAU keying off of advertising_id for your individual users.
@DATE => refers to to the date that you want to see DAU for.
@BUNDLEID => bundle_id for your app
@PLATFORM => platform of your app
*/

SELECT COUNT(DISTINCT coalesce(advertising_id, developer_device_id)) as dau
FROM events
WHERE created_at :: DATE = '2018-02-01'
  AND bundle_id = 'com.tenjin.wordfinder'
  AND platform = 'ios';

This will automatically calculate the DAU for my app on ios.

results matching ""

    No results matching ""