Tutorial | Dashboard management#

Dashboards are key tools for visualizing data. Let’s explore how to use and manage these native tools in Dataiku!

Get started#

Objectives#

In this tutorial, you will:

  • Edit an insight within your dashboard.

  • Filter the dashboard.

  • Share a filtered dashboard.

  • Export it as a PDF.

  • Use sampling on insights and filter tiles.

Prerequisites#

  • A Dataiku 12 instance.

  • A minimum of Dataiku 12.4 and 12.5 to enable cross filter’s Include and Exclude feature, respectively.

  • A basic level of knowledge about Dataiku is helpful. If you’ve never used Dataiku before, try the Core Designer learning path or a Quick Start tutorial!

Create the project#

  1. From the Dataiku Design homepage, click +New Project > DSS tutorials > Advanced Designer > Dashboard Management.

  2. From the project homepage, click Go to Flow.

Note

You can also download the starter project from this website and import it as a zip file.

Use case summary#

This project is a simplified credit card fraud use case. Using data about transactions, merchants, and cardholders, we have a model that predicts which transactions should be authorized and which are potentially fraudulent.

For the target variable, authorized_flag, a score of:

  • 1 represents an authorized transaction.

  • 0 is a transaction that failed authorization.

Edit the insight#

Let’s edit the pivot table insight added to the Purchase Patterns dashboard.

Note

The video at the end of this section below walks through all the steps described here. Play and pause the video as you read the instructions and edit the dashboard.

  1. From the top navigation bar, go to the Dashboards menu and open the Purchase Patterns dashboard.

  2. Click the external link icon next to Avg of purchase_amount by item_category and card_fico_score on transactions_known to open the insight. (Hover over the title to make the icon appear.)

  3. From the top-right corner, click on Edit.

  4. On the left panel, under Filters drop-down menu, click on the More action button of the FICO score filter and Remove filter.

  5. On the left, change Display measures as from Rows to Columns. Click Save.

  6. On the top-right, click on View or Back to dashboard to see the modified pivot table.

Note

If you return to transactions_known dataset and find the pivot table used to create the insight, that pivot table will not have these changes since insights and charts are independent objects. You can learn more about chart insights in the reference documentation.

Filter the dashboard#

We often need to provide the end user of a dashboard with the ability to interact with the insights on display. You can add data filters to an individual insight on its Edit tab, just like you would for a chart.

However, it also can be useful to have a filter that operates at the level of an entire dashboard slide. This way, multiple insights on the same dashboard slide can be subject to the same data filters.

Add a filters tile#

Let’s demonstrate how a filter tile works at the dashboard slide level.

Note

The video at the end of this section walks through all the steps described here. Play and pause the video as you read the instructions and apply a filter tile.

  1. From the dashboard’s Edit tab, click the blue + button to add a new tile.

  2. Choose a Filters tile.

The filters we add to the dashboard slide must reference a source dataset, so we can choose this dataset in two ways.

  1. In this case, choose Existing tile, and in the Source tile option, select Avg of purchase_amount by item_category and card_fico_score on transactions_known (i.e. the chart insight for the pivot table on transactions_known).

  2. Choose item_category as the column to use for the filter, and click Add.

  3. Adjust the size of the filter tile as needed, and click Save.

  4. Click on View to see the results. As you can see, by default, all item categories are selected.

Use the cross filters#

Let’s say while presenting the dashboard in View mode, you are questioned on a specific date or category of the data. The cross filters feature allows for dynamically filtering tiles in View mode by clicking on the existing tiles of the dashboard. For this example, assume we are interested in transactions with no signature provided, during the peak i.e. in December 2017, but only the items of the categories A, B, and C.

Note

In the Edit mode, in the Slide tab, verify that cross filtering is available as soon as a filter tile is set.

  1. On the transaction table insight, navigate to the signature_provided column.

  2. Right-click on a cell including a 1 and and select Include only 1.

  3. Still on the transaction table, navigate now to the item_category column.

  4. Right-click on a cell including a D and and select Exclude D.

  5. On the Number of transactions by month bar chart tile, right-click on the 2017-12-01 bar and select Include only purchase_date - 12/2017.

  6. Navigate back to the Edit mode.

You can notice that the cross filters set in View mode are temporary. Leaving the View mode or the Dashboard page will discard the filters set as they should remain dynamic for a presentation purpose. The filter tile can also be used in View mode.

Use filter tile in View mode#

Let’s see the filter tile in action!

  1. In View mode, in the filter tile, deselect categories B, C, and D. Just like when applying a cross filter, the insight tiles are dynamically updated.

  2. In the filter tile, from the More options menu of the item_category filter, select Disable filter to deactivate the filter, and see how the data has returned to the insights.

Change the default selections in the filter tile#

If we want to change the default selections for the filter tile, we can do so in the Edit tab.

  1. From the dashboard’s Edit tab, select the filter tile.

  2. In the Tile tab, we can adjust settings, including the default selections. Check only the box for category A, and click Save.

  3. Navigate back to the View tab to see that the default filter has changed, but the user can still make new selections.

Share a filtered dashboard via the URL#

Once you have filtered your dashboard, you can share the filtered view with other users by generating a URL containing all the filter parameters. This URL can then be shared with others.

  1. Go to the View tab.

  2. In the filter tile, click the Copy URL in clipboard button in the header. This action automatically computes the URL with the relevant filter parameters and copies it to your clipboard.

    Copy the URL of the filtered dashboard.
  3. Paste it anywhere to share it with the other stakeholders.

Note

The syntax of the generated URL is as follows:

${DASHBOARD_ID}_{DASHBOARD_NAME}/view/${VIEW_ID}?${FILTER_QUERY}

The filter parameters change based on the filtering options you select in the filter tile header (Include other values or Exclude other values). For further information on the generated URL, see the documentation on Filters query parameter syntax.

Export a filtered dashboard as a PDF#

You can also export a dashboard as a PDF with the filter parameters active in View mode. This can be done via the Dataiku interface or via the REST API.

Export using the Dataiku interface#

  1. Go to the View tab.

  2. In the right panel, select the Actions tab, then Export.

  3. Keep the default settings and click Export Dashboard.

The PDF will be downloaded to your file system and include the dashboard view with your selected filters.

Export using the REST API#

You can also use the REST API to export the dashboard using the export endpoint. In such case, the syntax of the POST URL is:

https://DSS_HOST:DSS_PORT/public/api/projects/{PROJECT_KEY}/dashboards/{DASHBOARD_KEY}/actions/export

Note

In the POST URL, {DASHBOARD_KEY} is the key of the dashboard, not the slide. So if the dashboard URL is:

https://DSS_HOST:DSS_PORT/projects/QS_AI_CONSUMER_1/dashboards/oLeWRKL_purchase-patterns/view/GcHERXM

The POST URL should be:

https://DSS_HOST:DSS_PORT/public/api/projects/QS_AI_CONSUMER_1/dashboards/oLeWRKL/actions/export

The body of your request should look like this:

{
  "paperSize": "A4",
  "orientation": "LANDSCAPE",
  "fileType": "PDF",
  "width": 2505,
  "height": 1771,
  "filtersBySlide": ["item_category:\"A\""]
}
Example of an API call to export your dashboard.

Understand source datasets for filter tiles#

Two more concepts about filter tiles are essential to understand.

The values in a filter tile come from a chosen column (or columns) in one source dataset.

  1. When this filter tile is activated, you’ll notice a filter icon in the top right corner of each insight.

  2. Hover over the filter icon to see the tooltip for each insight.

For the pivot table, the tooltip says Data is filtered, but, for the other two insights, the tooltip also notes a risk of inconsistency because the datasets are different.

Dataiku screenshot of a dashboard showing a filter tile tooltip where datasets are different.

The tooltip alerts us to the fact that the source dataset of the filter tile is different from the source dataset of the other insights. The source dataset for the filter tile and the pivot table is transactions_known, while the source dataset for the bar chart and scatter plot is transactions_joined_prepared.

The filter tile, however, is applied to every insight on the dashboard slide. Is this a problem?

In this case, the values for item_category for transactions_known and transactions_joined_prepared happen to be the same (A, B, C, and D), but there is no guarantee that this will be true.

Imagine, for example, that the dataset transactions_joined_prepared had rows with a category E that were not found in transactions_known. Category E would not appear as an option in the filter tile (which is based only on the values found in transactions_known).

The insights on transactions_joined_prepared would not include any category E rows. They’d be filtered out without us explicitly knowing. Accordingly, we need to be particularly careful about using a filter tile on a dashboard slide with insights from different source datasets.

Let’s change the source dataset of the filter tile to be sure we understand the meaning of this message.

  1. In the dashboard’s Edit tab, return to the Tile tab of the filter tile.

  2. Click Change Source Dataset > Other Dataset .

  3. Choose transactions_joined_prepared as the source dataset and item_category as the column.

  4. Save the change, and navigate back to the View tab.

Dataiku screenshot of an insight inconsistent with a filter tile due to different source datasets.

Note how the display label on the filter tile has changed, and the messages on the Filter icon tooltip are reversed. The pivot table insight is now at risk of inconsistency!

Use sampling on insights vs. filter tiles#

We know that the sampling method for a chart is independent from the sampling method for an insight produced from it. Filter tiles also have their own sampling method.

For example, to avoid too many overlapping points, we may prefer to use a sampling method on the scatter plot insight.

  1. Navigate to the Edit tab of the scatter plot insight.

    Note

    Clicking the arrow next to the insight title opens the insight.

  2. On the Sampling & Engine tab, change the Sampling method to Random (approx. ratio). Click Save and Refresh Sample.

  3. Save the insight, and return to the dashboard’s View tab.

  4. In the dashboard’s View tab, hover over the Sampled tag to see more information about the sample size for this insight.

Dataiku screenshot of a dashboard insight with a sampled tag.

How does this sample interact with the filter tile?

  1. In the dashboard’s View tab, ensure that the filter tile is activated and only values A are included for example.

  2. Observe the filter icon tooltips for all three insights.

  3. The scatter plot has a risk of inconsistency because the insight sample differs from the filter tile sample.

Dataiku screenshot of an insight inconsistent with a filter tile due to different samples.

In this specific case, the risk may be manageable. We have a random sample in the insight, and the filter tile has removed any rows with an item_category other than A.

However, as a demonstration, we could use the same sampling strategy in the filter tile itself.

  1. Return to the tile menu of the filter tile in the dashboard’s Edit tab.

  2. In the Sampling & Engine tab, change the Sampling method to Random (approx. ratio).

  3. Click Apply, save the result, and return to the dashboard’s View tab.

The filter tile now also has a sampled tag. The four categories, in this case, still remain in the random sample.

  1. Check the filter icon tooltips once more.

  2. The tooltip on the pivot table still warns about a different dataset, but the tooltip on the bar chart notes the different sampling strategy.

Dataiku screenshot highlighting filter tiles and sampling methods.

What’s next?#

Congratulations! You’ve managed, edited, and filtered a dashboard that is ready to be shared with stakeholders.

The next step might be publishing the dashboard on a workspace.

Note

Consult the reference documentation to learn more about dashboards, including insights.

To learn more about visualization with code, such as webapps and static insights, you might want to check out the Academy course on Visualization.