question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enable drill by dimension on charts

See original GitHub issue

Description

A common flow that users take is:

  • Click a chart element to get the context menu
  • Click “show underlying values”
  • Then “explore from here” - which launches a blank explore with the correct filters applied from the chart segment
  • And then in the sidebar, change the dimensions to explore that segment by a different dimension

We could make this journey substantially shorter by allowing the user to choose a dimension directly from the context menu. The new flow:

  • Click a chart element to get the context menu
  • Choose “Drill by…” and show a list of available dimensions for that chart
  • Click a dimension (e.g. country)
  • Launch a new explore (in a new tab) with the correct filters AND the original metrics from the chart and selected dimensions.

Example

From demo.lightdash.com

Exploring: support requests (each row is a single support request)

Starting chart shows the number of requests created per month

  • Metric: total requests
  • Dimension: created date month

Link: https://lightdash-demo-thyme.onrender.com/share/-Vp7tr3UkBOdTmCoGtCJu

The chart has 4 months of data. And 2022-01 is a big outlier (so many requests!!). So I click on the bar and see “view underlying data”. I would also like to see Drill By…

Screenshot 2022-12-01 at 14 35 17

Next I click drill by “reason” - “reason” is a category we attach to support tickets. So I’m saying “I want to further drill that bar by reason”.

This would launch me into a new chart showing:

  • Metric: total requests (same metric)
  • Dimension: reason (the selected drill field)
  • Filter: created date month = 2022-01 (the selected segment)

Link: https://lightdash-demo-thyme.onrender.com/share/NNC-IQ4tx-T0ocDvCE-BT

Screenshot 2022-12-01 at 14 37 41

Now I can see that there were many product related queries and delivery issues during that month. That might explain the spike in the bar!

Implementation

This is very similar to the existing implementation for view underlying values, where we’re basically constructing a new explore.

See this file for logic: https://github.com/lightdash/lightdash/blob/main/packages/frontend/src/components/UnderlyingData/UnderlyingDataModalContent.tsx#L42-L42

This logic should live in common along with other functions that generate explores / metric queries (e.g. applying dashboard filters to a query, getting query for underlying data, generating drill by queries etc.).

A summary of the acceptance criteria

  • Any chart element that encodes a single metric will now have the option to drill by in the context menu.
  • You need to select a dimension to drill by
  • You can select a dimension from any of the table’s available dimensions (both the primary model and the joined models).
  • There’s a way to search for which dimension you want to add (similar to the filter selection component?)
  • drill by launches a new explore (in a new tab) with:
    • the same filters as the original chart
    • an added filter for the x-axis value from the original chart value you clicked drill by on
    • if your chart was grouped, then there’s an added filter for the group the value belonged to (e.g. if I had grouped my chart by cloud and self-hosted, but clicked drill by on the self-hosted part of the bar, then we’d add a self-hosted filter to the new chart)
    • the same y-axis values as the original chart
    • the x-axis value now becomes the dimension that you selected to drill by
  • see an example of how this would work from a value in the results table here
  • The chart that is opened from a drill by is just the default chart configurations (we don’t keep any of the config that was changed from the original chart).
  • You can drill into any chart element that encodes a single metric. So points on a line, bars, bar segments, big numbers, value in a table. As long as the value clicked encodes a single metric
  • Things you can’t drill into:
    • Point on a scatter chart of a dimension vs dimension
    • Point on a scatter chart of a metric vs metric
    • Value in a table that is a dimension
    • Any point that’s a table calculation

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
owlascommented, Dec 6, 2022

Ah I missed out groups! They would be become part of the filters just like in “show underlying values” so the result is always an ungrouped chart.

1reaction
owlascommented, Dec 1, 2022

Good questions!!

Can I “drill down” on a dimension? Or only metrics?

Can I drill down from a point…

You can drill into any chart element that encodes a single metric. So points on a line, bars, bar segments, big numbers, value in a table. As long as the value clicked encodes a single metric

Things you can’t drill into:

  • Point on a scatter chart of a dimension vs dimension
  • Point on a scatter chart of a metric vs metric
  • Value in a table that is a dimension
  • Any point that’s a table calculation

Do we use the same chart type

v1 I would use a blank explore with the default chart

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dimension Drill-Down Now Available in Google Data Studio
The drill down feature allows Data Studio users to select a dimension within a chart and drill down for more detail. Examples: User...
Read more >
Using Drill-Down Charts in Data Studio - ClickInsight
Once enabled, drill down allows you to add more dimensions to your chart. List the dimensions in order from most broad to most...
Read more >
Add drill-down to a Power View chart or matrix
To enable drill-down, collapse the matrix. From the Design tab > Show Levels > Enable Drill Down One Level at a Time. Power...
Read more >
An In-Depth Look Into Data Studio Drill Down
How to Use Drill Down Charts in Data Studio · Click on the link that says “Edit your report” · Select which chart...
Read more >
Understanding drill down and breakdown dimensions in Data ...
When you select a chart, you can see it in the right bar in the dimension area. ... We choose all three types...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found