The new Explore experience includes the Join data page, which lets you join two or more queries and display the query results as if they were one query.
Required roles
To join queries, you must have the User Looker role or another role that contains the explore permission.
Accessing the new Explore experience
To access the new Explore experience, the New Looker Explore Experience preview feature must be enabled for your instance. If you're not a Looker admin, ask an admin to enable the feature.
From an Explore page, click Try the new Explore to navigate to the new Explore experience for all Explores that you interact with.
From the Merge Results page, click Try the new Merge Results to navigate to the new Explore experience Join data page.
Joining queries
To join the results from multiple queries, follow these steps:
- Create the first source query, called the primary query.
- Add the next source query.
- Optionally, you can configure join rules for the joined query.
- Optionally, you can modify the joined query
- After you've created the joined query, you can save or share the joined query.
Creating the primary query
To join the results from multiple queries, start by preparing the primary query by selecting an Explore from the Explore menu and then selecting the dimensions and measures of interest from the field picker. Alternatively, select a Look or dashboard, and click Explore from here on the Look, or from a dashboard tile.
This is all you need to start merging results. However, you can also further refine your query in the following optional ways:
- Add filters for the data.
- Include table calculations to create ad hoc metrics.
- Click Run to see the results of your primary query and to test your filters and table calculations.
Adding the next source query
Once you've created your primary Explore, add another source query by following these steps:
- In your Explore Configure panel, click Merge queries (join data). This opens the Join data page.
In the Add join window, choose the method that you'll use to add another source query:
- Build a new query from an Explore: Looker displays a list of Explores. Choose the Explore that you want to use as a source query, and click Add query. Looker will display the Configure joined fields page. Select the dimensions and measures for your new query and add any filters, pivots, or custom fields. When you're finished configuring your new source query, click Save and Continue.
- Paste prebuilt query URL: In the Add prebuilt query URL field, enter the URL of the query, Look, or dashboard tile that you want to use as a source query and click Add query.
- Select Look: Looker displays a list of Looks. Choose the Look that you want to use as a source query, and click Add query.
- Select Dashboard tile: Looker displays a list of dashboards. Choose a dashboard, and then Looker shows a list of tiles on that dashboard. Select a tile and click Add query.
Configuring join rules
In order to join two or more queries, the queries need to have a field in common. For example, if you wanted to add customer data to an Explore of orders, if the orders Explore and the customer query both had a Customer ID field, you would use that field to join the queries.
Once you've selected and configured your primary and additional source queries, Looker will automatically select one or more join fields and create join rules in the Join rules tab in the Configure joins window.
In the Join rules tab, you can modify the join rules in the following ways:
- Change the join field of either the primary query or a source query.
- Add new join fields.
- Delete join fields.
- Make a source query the primary query.
- Add a new source query by clicking Add join.
After you make any changes, you can view the results of the new joined query by clicking Run to update.
Modifying the joined query
After you've created your joined query, you can modify it in the following ways:
- In the Configure joined fields window, pivot one or more of the joined query fields and add table calculations.
- In the Style tab of the Configure joins window, change the settings of the join query visualization.
- Use the Totals toggle to add or remove totals from the joined query.
- Click Change chart to select a different visualization for your joined query.
After you make any changes, you can view the results of the new joined query by clicking Run to update.
Saving or sharing the joined query
After you've created your joined query, you can click Save or Share to perform the following:
- Save to a new dashboard: Looker displays the Save as a new dashboard window. Give the new dashboard a title and select a folder where you want the new dashboard to be saved.
- Save to an existing dashboard: Looker displays the Add to a Dashboard in this folder window. Enter a title for the new dashboard tile, and select the dashboard that you want to save the query to.
- Copy URL: Looker displays the Share URLs window, displaying the query's short URL and expanded URL.