Table Format

How to write queries for your warehouse data sources

The queries must return a date column, one or more value columns for the variables, and optional columns for categories, category mappings, or cohorts. The variable columns can be numbers or dates. Here is an example:

select date, users, country, region as "country > region" from users_tableselect date, users, country, region as "country > region" from users_table
  • The first column has the dates of the transactions (timestamp or date type)
  • The second column contains the values of the "users" variable (number type)
  • The third column is a category column, the users are broken down by country (string)
  • The fourth column is a category mapping. The region is not an independent category, but the countries are assigned to regions. The name of the column is important, it should have the format from dimension > to dimension. For more details on category mappings check out linking categories
Example query result

If you only want to import constant values (no time series) the date column can be null.

select null as date, price, plan_name from price_table