
## Data Exploration tips and tricks

URL: https://docs.atlan.com/product/capabilities/insights/references/tips-and-tricks

> At Atlan, the goal is to power your user experience. Here are a few tips and tricks to help you get the most out of Data Exploration for you and your team!

Atlan is committed to powering your user experience. Here are a few tips and tricks to help you get the most out of Data Exploration for you and your team!

## Export large query results via email

:::warning Who can do this?
 You will need your Atlan administrator to [enable scheduled queries](https://docs.atlan.com/llms/governance/administration/enable-scheduled-queries/llms.txt). Once enabled, you need to be a connection admin to [increase the query limit](https://docs.atlan.com/llms/catalog/connector-capabilities/manage-connectivity/llms.txt) to more than 100,000 rows. Atlan currently has an upper limit of 30 million rows. Reach out to your data success manager if you’d like to increase the limit for your organization.

:::

Previously, users could only scan and see query results for up to 100,000 rows by default. To help you scan more rows and export those results, you can now export queries for more than 100,000 rows directly to your email inbox.

To export query results for more than 100,000 rows to your email inbox:

1. In the query editor in _Insights_, type a limit for more than 100,000. 
 (Note: Be sure to uncheck the **Limit to 100 rows** box in the query editor.)
2. Click **Run** to run the query.
3. The query results set will only display 100,000 rows. In the yellow bar above the query results set, click **Send results via email**.
4. You will need to save the query to get the results via email. In the _Save Query_ dialog box:
 1. Select the relevant _Query collection_ to save your query. If you haven't created one, you will get a prompt to [create a query collection](https://docs.atlan.com/llms/catalog/insights/save-and-share-queries/llms.txt) during this step. 
 2. For _Query name_, type a name for your query.
 3. (Optional) Add a description, certification status, and term. 
 4. Click **Save Query** to receive the query results in your email inbox.
5. (Optional) To [add an announcement](https://docs.atlan.com/llms/governance/integrations/create-announcements/llms.txt) to alert others in your team, click **Add Announcement**. 

The query results will be delivered to your email inbox in a CSV file! 🎉

If your saved query consists of multiple queries, you'll receive the results for each query in a separate CSV file.

:::info **Did you know?** 
 Once the query run is successful, you will also be able to download the query results as a CSV file directly in Atlan. If you don’t wish to run the query, you can abort the query at any time. If you have any questions, head over [here](https://docs.atlan.com/llms/catalog/insights/troubleshooting-exporting-large-query-results/llms.txt).

:::

## Open asset sidebar from data exploration

To get all the context you need before querying an asset, you can open the asset sidebar directly from _Insights_.

To open the asset sidebar:

- In the _Explorer_ left panel in _Insights_, hover over a table and click on the **Open sidebar** icon. (The name may vary depending on the asset type, such as _Open table sidebar_ for table assets).

You will now be able to view the asset sidebar for the asset you'd like to query! 🎉

## Search and sort query results

### Search query results

With the search feature enabled for query results, you can use the search bar to type a search term and filter your results by that specific term. 

To search your query results after running a query:

1. In the query results set in _Insights_, click the **Search results** bar.
2. In the _Search results_ bar, type your search term, such as `Tuesday`, to see the query results for that term.

### Sort query results

If you'd like to sort your query results, use the sort feature to order your query results. 

To sort your query results after running a query:

- In the query results set in _Insights_, click on a **column name**, such as `user id`, to sort your results in an ascending or descending order.

:::info **Did you know?** 
 Atlan currently supports text, number, and Boolean data types for sorting query results.

:::

## Add inferred data types

:::warning

Atlan currently supports inferred data types only for [Databricks](https://docs.atlan.com/llms/connectors/databricks/set-up-databricks/llms.txt) and [Snowflake](https://docs.atlan.com/llms/connectors/snowflake/set-up-snowflake/llms.txt) assets.

:::

If your column data is stored in a standard data type - for example, `STRING` - you can add an inferred data type to the column. This will help you query the data [using the Visual Query Builder](https://docs.atlan.com/llms/catalog/insights/query-data/llms.txt). 

For example, if your column contains dates stored in a `STRING` format, you can infer this column as a `DATE` data type in Atlan.

To add an inferred data type:

:::warning

You will need to select an acceptable inferred data type as per your data source.

:::

### From a query

1. From the left sidebar, click on **all assets** and then click on **Queries**.
 * If you are using the **Old UI (Classic)**, click on **Data Exploration** from the left sidebar..
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 you want to query.
4. In the column selector to the right, select the column to which you want to add an inferred data type - for this example, we'll choose a column with a `STRING` data type, `stringDateColumn`.
5. Hover over your selected column, and in the top right of the metadata popover, click the **Open sidebar** icon.
6. At the top of the column sidebar, click the **three dots** icon and then click **Add inferred datatype**.
7. For _Add Inferred datatype_, type a secondary data type - for this example, we'll add a `DATE` data type.
8. Click **Add** to add your inferred data type. 
9. (Optional) To query the column with an inferred data type:
 1. In the query editor, click the blue circular **+** button and then select **Filter** as the action.
 2. For _WHERE_, select the column with an inferred data type.
 3. Under the selected column, click the inferred data type option to query the column in Atlan.

### From an asset

1. On the Atlan homepage, click on **all assets**.
 * If you are using the **Old UI (Classic)**, from the left menu of any screen, click **Assets**.
2. On the _Assets_ page, click a column asset with a `STRING` data type to open the asset sidebar - for example, `stringDateColumn`.
3. At the top of the column sidebar, click the **three dots** icon and then click **Add inferred datatype**.
4. For _Add Inferred datatype_, type a secondary data type - for this example, we'll add a `DATE` data type.
5. Click **Add** to add your inferred data type.

The inferred data type for your selected column will now be displayed in the asset sidebar! 🎉

To remove the inferred data type from a column asset, click the **pencil** icon. In the dialog, click **x** to remove the data type and then click **Remove** to confirm removal. 

## View querying costs

To help you gain the most value-driven insights in Atlan, you will receive a cost nudge before querying your Google BigQuery [views](https://docs.atlan.com/llms/connectors/google-bigquery/what-does-atlan-crawl-from-google-bigquery/llms.txt) and [materialized views](https://docs.atlan.com/llms/connectors/google-bigquery/what-does-atlan-crawl-from-google-bigquery/llms.txt). This will inform you about the precise bytes that will be spent during the execution of the query, helping you decide if you would still like to run the query. For all subsequent runs of the same query, Atlan will use [cached query results](https://cloud.google.com/bigquery/docs/cached-results) from Google BigQuery - note that the query text must be the same as the original query.

Google BigQuery table assets are already cost-optimized for querying.

To [view querying costs](https://cloud.google.com/bigquery/pricing) for a Google BigQuery view:

1. Under the _Explorer_ tab in _Insights_, hover over a Google BigQuery view and click the play icon.
2. In the cost preview dialog, click **Cancel** to cancel running the query based on the costs shown or click **Run** to proceed with running the query.

:::info **Did you know?** 
 You will also receive a cost nudge before viewing [Google BigQuery sample data previews](https://docs.atlan.com/llms/connectors/google-bigquery/what-does-atlan-crawl-from-google-bigquery/llms.txt).

:::

---
