Build a dashboard with sample data
Learn how to create a dashboard with sample data from the Intermediate EcommerceExplore in the sample LookML project on your Looker (Google Cloud core) instance.
This quickstart guides you through building a dashboard with the following tiles, including an optional Look-linked tile that you can add to your dashboard if you've completed the Build a Look with sample data quickstart:
- Top Weekly Spenders: Identify the top spenders for the past four weeks to target them with personalized promotions.
- Yearly Sales Goal Tracking (2024): Visualize your year-to-date sales and compare them to a set goal by using table calculations to visualize a a running total and by adding a reference line.
- (Optional) Weekly Shipping Trends (Last 8 Weeks): If you've completed the Build a Look with sample data quickstart, you can also add your shipping delay analysis Look to this dashboard.
Before you begin
To follow along with this quickstart, you'll need access to a Looker (Google Cloud core) instance that includes the sample LookML project . The sample project includes the prebuilt Intermediate EcommerceExplore that is used in this quickstart.
Optionally, if you want to incorporate a pre-existing Look into your dashboard, you can follow the instructions in the Build a Look with sample data quickstart.
You'll also need to have a the following Looker permissions on your Looker (Google Cloud core) instance (or a Looker role that includes these permissions):
-
access_data
: Access the sample data in the Intermediate EcommerceExplore -
explore
(and its parent permission,see_looks
): Access the Explore page and run queries in the Intermediate EcommerceExplore. -
see_user_dashboards
(and its parent permission,see_looks
): View the Sales and Customer Insightsdashboard. -
save_dashboards
(and its parent permission,save_content
): Save and edit the Sales and Customer Insightsdashboard. -
save_looks
(and its parent permission,save_content
): Save the Weekly Shipping Trends (Last 8 Weeks)Look (if you complete the Build a Look with sample data quickstart). -
create_table_calculations
: Create the table calculations for the Yearly Sales Goal Tracking (2024)tile.
Create the new dashboard from an Explore
This section guides you through querying data and creating a visualization for the Top Weekly Spenderstile, which will show the top 15 customers by sales in the last 4 weeks. You'll then save the visualization as the first tile on your new dashboard.
Navigate to the Explore
First, you'll use the Intermediate EcommerceExplore to visualize the sample data. To navigate to the Intermediate EcommerceExplore, follow these steps:
- In Looker, click Main menu to expand the main navigation menu, if not already expanded.
- In the main navigation menu, select Explore.
- Click Z) Sample LookML(or the corresponding model name on your instance) to expand the list of Explores, if not already expanded.
- Click 2) Intermediate EcommerceExplore to open the Explore page.
Query and visualize the data
Next, you'll select fields from the Intermediate EcommerceExplore and then define the visualization for the Top Weekly Spenderstile, which shows the top 15 customers by sales in the last 4 weeks. To select fields and visualize the sample data, follow these steps:
- In the Intermediate EcommerceExplore, select the following fields from the field picker:
- Users> Email
- System Keys> User ID (On Order Item)
- Order Items> Sales (Validated)
- In the Datasection of the Explore, set the value of Row Limitto
15
. - In the Datasection of the Explore, click the gear menu for the System Keys User ID (On Order Item)field, and then select Hide this field from visualization.
- To create a filter that limits the data to the last 4 weeks, follow these steps:
- Click the Filterssection of the Explore to show the filter options, and then click + Filter.
- In the Add Filterwindow, expand the Order Itemsview to show the Created At Datedimension group.
- Under the Created At Datedimension group, select the Created At Weekfield.
- Set the filter condition to is in the lastand enter the value
4
in the text input field, and then select weeksfrom the list of timeframes.
- In the Datasection of the Explore, click the Order Items Sales (Validated)field to sort the results by the Order Items Sales (Validated)field in descending order.
- To run the query and display the results, click Run.
- Click the Visualizationsection of the Explore to see the visualization of the query results.
Looker displays the query results in the Visualizationsection of the Explore page, with the query results showing only the top 15 customers by sales amounts in the last 4 weeks.
Save your visualization as a new dashboard
To save the visualization that you created in the previous section as a new dashboard, follow these steps:
- Click the Explore actionsgear icon and select Save, and then select As a new dashboard.
- In the Save as a new dashboardwindow, in the Titlefield, enter a title. This title will be applied to both the new dashboard and the tile that you have created. You can change the title of the dashboard later if you want to.
- In the Settingstab, in the Folderssection, select the folder to which you want to save the dashboard.
- Click Save. Looker displays a notification informing you that your tile has been saved to a new dashboard.
- Optionally, click the View dashboardlink within the notification to be taken directly to your new dashboard in edit mode
. When in edit mode, you can select the existing dashboard title and enter a new title. In this example, you can enter
Sales and Customer Insights
as the title.
Add additional tiles to the dashboard
Next, you'll add more tiles to your dashboard. You'll create a query tile that tracks progress against a yearly sales goal and, if you completed the Build a Look with sample data quickstart, you'll add that Look to your dashboard as a tile.
Create a new query tile within the dashboard
In this section, you'll create the Sales Goal Tracking (2024)tile, which will show your cumulative sales over time compared to a yearly sales goal and uses table calculations to define the running total and the target sales.
To create the tile from within the Sales and Customer Insightsdashboard, follow these steps:
- Navigate to your Sales and Customer Insightsdashboard.
- Click the Dashboard actionsthree-dot icon , and then select Edit dashboard.
- In the page header, click Add, and then select Visualization.
- In the Choose an Explorewindow, select the Intermediate EcommerceExplore.
- In the title field, enter a title (in this example, enter
Sales Goal Tracking (2024)
). - In the Explore field picker, select the following fields:
- Order Items> Created At Week
- Order Items> Sales (Validated)
- To filter the data to show only 2024 sales, follow these steps:
- Click the Filterssection of the Explore to show the filter options, and then click + Filter.
- In the Add Filterwindow, expand the Order Itemsview to see the fields in the Created At Datedimension group.
- Under the Created At Datedimension group, select the Created At Datefield and choose the is in the yearcondition. Enter
2024
in the text input field.
- In the Custom Fieldssection, click Addand then select Table Calculationto create the following table calculations:
- Cumulative Sales:
- Enter the formula
running_total(${order_items.total_sales_price_validated})
. - Set the value of Formatto short_dollars.
- In the Namefield, enter
Cumulative Sales
. - To save the table calculation, click Save.
- Enter the formula
- Target Sales:
- Enter the formula
row() * 72000 + (${cumulative_sales} * 0)
. - Set the value of Formatto Decimals.
- Set the value of Decimalsto 0.
- In the Namefield, enter
Target Sales
. - To save the table calculation, click Save.
- Enter the formula
- Cumulative Sales:
- To hide the Order Items Sales (Validated)field from the visualization, in the Datasection of the Explore, click the gear menu for the Order Items Sales (Validated)field, and then select Hide this field from visualization.
- To run the query and visualize the query results, click Run.
- In the Visualizationsection of the Explore, configure the visualization:
- In the Visualizationmenu, select Columnto display the query results in columns.
- Click Edit to open the Visualizationmenu.
- In the Seriestab, in the Customizationssection, expand Target Sales, then in the Typefield select the Lineoption.
- In the Ytab, in the Markingssection, click Add Reference Line. In the Valuemenu, select Custom, and then enter the value
3750000
in the text input field. This value represents the yearly sales goal. - Set the Label Positionsetting to Center.`
- To save the visualization, click Save.
- In the Edit Dashboardwindow, click Saveto save the dashboard.
The Sales Goal Tracking (2024)tile is now displayed on the Sales and Customer Insightsdashboard.
Add an existing Look as a tile (Optional)
If you have completed the Build a Look with sample data quickstart, you can add your Weekly Shipping Trends (Last 8 Weeks)Look to your dashboard as a tile.
To add this Look to the Sales and Customer Insightsdashboard, follow these steps:
- In the Looker main navigation menu, navigate to the folder where you saved your Weekly Shipping Trends (Last 8 Weeks)Look.
- Click the Weekly Shipping Trends (Last 8 Weeks)Look.
- Within the Look, click the Explore actionsgear icon , select Save, and then select To an existing dashboard.
- In the Add to a Dashboard in this folderwindow, select the Sales and Customer Insightsdashboard.
-
Click Save to Dashboard.
The Weekly Shipping Trends (Last 8 Weeks)tile is now displayed as a static query tile on the Sales and Customer Insightsdashboard. You may need to refresh the page to see the newly added Look in your dashboard.
Create an interactive dashboard filter
In this section, you'll add an interactive dashboard filter to the Sales and Customer Insightsdashboard. This filter lets viewers dynamically adjust the timeframe for the data displayed, choosing options like Today, Last 7 Days, or Last 30 Days.
To add a relative date filter on the Order Items Created At Datefield, follow these steps:
- Navigate to the Sales and Customer Insightsdashboard.
- Click the Dashboard actionsthree-dot icon , and then select Edit dashboard.
- In the page header, click Filters, and then select Add filter.
- In the Add Filterwindow, in the Filter bysection, expand the Order Itemsview, then expand the Created At Datedimension group, then select the Created At Datefield.
- In the Titlefield, enter
Order Date
. - Optionally, in the Configure Default Valuesection, select the timeframe that you want to be displayed by default.
- Optionally, in the Tiles To Updatetab of the Add Filterwindow, configure the tiles that you want to update when the filter is applied.
- Click Add.
The Order Datefilter is now added to the Sales and Customer Insightsdashboard. Users can now filter the data by selecting timeframes like Today, Last 7 Days, or Last 30 Days.
Reposition and resize the dashboard tiles
This section explains how to arrange and format the tiles on your dashboard to customize its layout and appearance. To reposition or resize tiles on your dashboard, follow these steps:
- Navigate to the Sales and Customer Insightsdashboard.
- Click the Dashboard actionsthree-dot icon , and then select Edit dashboard.
- To reposition a tile, click and hold the tile's six-dot Hold and drag to reordericon , and then drag the tile to its new location.
- To resize a tile, hold your cursor over the bottom right corner of the tile, and then click and hold to drag the tile's border to resize it.