How to query data

Have more questions? Submit a request

There are three ways to query data in Atlan:

  • writing your own SQL
  • through dbt's Semantic Layer
  • using the Visual Query Builder
πŸ’ͺ Did you know? Atlan pushes all queries to the source (no data is stored in Atlan). In addition, Atlan applies access policies to the results before displaying them.

Write your own SQL

πŸ€“ Who can do this? Anyone with the knowledge to write SQL. You will need to be an Admin or a Member user with data access to the asset.

To query an asset with your own SQL:

  1. From the left menu of any screen, click Insights.
  2. Under the Explorer tab, find the asset you want to query:
    1. Use the Select database drop-down to choose another database, if necessary.
    2. Search for the asset by name in the search bar, or browse for it in the tree structure.
  3. Hover over the table or view, and click the play icon. This writes and runs a basic preview query.
  4. Under the Untitled tab on the right, change the sample query or write your own. Click the Run button in the upper right to test your query as you write it.

The editor supports all read-based SQL statements, including join. The editor will not run any write-based statements.

πŸ’ͺ Did you know? You can select the context for your query to the left of the Run button. Then you won't need to fully-qualify table names with schema and database names.

Use dbt's Semantic Layer

πŸ€“ Who can do this? Only those with early access to our latest dbt integration can integrate the dbt Semantic Layer. (For all others, watch this space β€” it's coming soon!)
🚨 Careful! Querying metrics is currently only possible when using dbt Cloud, and only with Snowflake as the source.

To get the latest data for a metric:

  1. From the left menu of any screen, click Insights.
  2. Under the Explorer tab, find the dbt connection with the metric you want to query:
    1. Use the Select database drop-down to choose the dbt connection.
    2. Search for the metric by name in the search bar, or browse for it in the list of metrics.
  3. Hover over the metric, and click the play icon. This writes and runs a basic metrics calculation query.
  4. Under the Metric preview tab on the right, change the sample query or write your own. Click the Run button in the upper right to test your query as you write it. For example, to query a customers metric with a location_name dimension, by year:
    select *
    from {{ metrics.calculate(
        metric('customers'),
        grain='year',
        dimensions=['location_name']
    ) }}
    
πŸ’ͺ Did you know? You can hover over any metric on the left and click the sidebar icon to see additional details β€” such as the dimensions that exist on the metric.

Use the Visual Query Builder

πŸ€“ Who can do this? Any Admin or a Member user with data access to the asset. No SQL knowledge required!

To query an asset using the Visual Query Builder:

  1. From the left menu of any screen, click Insights.
  2. At the top of the screen, to the right of the Untitled tab, click the + button and select New Visual Query.
  3. Under Select from choose the table or view you want to query.
  4. Then develop your query:
    • Click the Run button to run the query and preview its results.
    • Click the blue circular + button to add an action to the query.
    • Repeat these steps until your query is complete.

Related articles

Was this article helpful?
1 out of 1 found this helpful