Question

Drill using a sparkline or other images

  • 1 June 2015
  • 0 replies
  • 730 views

Userlevel 4
Badge

###Objective

Add a nice sparkline to encourage users to link out to wherever the sparkline points. I’ve most often seen sparklines used as links to dashboards, but that doesn’t mean we are limited to such behavior! Using Looker’s html parameter to deploy custom drill you can link your users anywhere.


###How do we do it?


The sparkline is built into Looker’s file system. Self-hosted Looker customers can add custom images and use the same syntax to add images to a dimension/measure.


- dimension: sparkline_drill
type: string
sql: ${name}
html: |
{{ linked_value }}
<a href="/dashboards/model/dashboard_name?name={{ value }}" target="_new">
<img src="/images/qr-graph-line@2x.png" height=20 width=20></a>

###What does it look like?

Going to steal an example from the drill to dashboard article


Example screenshots below.


Overview Dashboard. Sparklines link to individual dashboards for each brand (highlighted in red), where the value from a given row is passed to a filter for the Brand Dashboard.



Brand Dashboard. Here we drilled in to Calvin Klein’s dashboard via the sparkline (using the LookML above passed via {{ value }}).



###Live LookML example

Here’s a link to the products view on learn.looker.com where you can tweak the code in your own dev directory to see how it changes. If you do not have a learn account visit help.looker.com and we can get you hooked up.


0 replies

Be the first to reply!

Reply