How to get visualization configurations for custom drilling

  • 17 February 2021
  • 8 replies
  • 658 views

Author: Won Park @wonkyoung.park 

The Help Center article More Powerful Data Drilling provides a detailed overview of how to create custom drills using liquid variables. The Visual Drilling section outlines how to provide users with a visual drilling experience (other than the default data table) by using Looker’s visualization settings in a URL. 

This article provides supplemental instructions for how to obtain those visualization settings and apply them to a drill field in LookML.

  1. Enable the Visual Drilling labs feature.
  2. Enter development mode and navigate to the project and LookML file containing the field to which you’d like to add the visual drill. Add the drill_fields parameter within the definition of the field, and specify the fields to be included in the drill visualization.
  3. Go to an Explore containing the field and drill into it. You will see a default visualization in the drill modal.
  4. Click Explore from Here from the drill modal.
  5. In the Explore that you are redirected to, modify the default drill visualization as needed to create the desired visualization. For example, choose a different type of chart, change the colors, add grid lines, etc.
  6. Once you have the visualization you want, click the Explore’s gear icon, select Share, and copy the Expanded URL.
  7. Paste the Expanded URL into a URL decoder (such as MeyerWeb) and “decode.”
  8. Copy the decoded URL, paste it into a JSON string escaper (such as FreeFormatter), and “Escape.”
  9. Copy the part of the escaped output after `&vis={` and before `}&filter_config=`

  10. Go back to the LookML project with the drill field definition, add the following, replacing "[this is where you enter the vis config details]": with the escaped string from step 9: 
    link: {
          label: "Show as line plot" #or your label of choice 
           url: "
          {% assign vis_config = '{
          [this is where you enter the vis config details]
          }' %}
          {{ link }}&vis_config={{ vis_config | encode_uri }}&toggle=dat,pik,vis&limit=5000"
        }
  11.  Save, validate your LookML, and push your changes to production when you are ready!

 


8 replies

Hello @lauren.boltz 

 

First of all thanks for this post, this is becoming really helpful for me at the moment. However I do have some questions that perhaps you can help me with?

 

While following your instructions, I have now come up with the escaped string mentioned in step 9.

On step 10 you mention that I would have to replace a piece of text between brackets with the escaped string but (and forgive me, I'm quite new to looker) I didn't fully catch if I should keep the VIS keyword while copying the escaped string, I also don't know if I should keep the brackets or remove them when replacing that piece of text.

The reason for those two questions is that I am coming up with a very long escaped string and when I paste it, suddenly I end up with a long gray line while at first the text was orange so I think I’m doing something wrong or my string is just simply too long or something.

 

Can you help me with this !?

Hi @Beto ! Thank you so much for the comment!

We would not want to keep the [ ] around the vis config details. It should look like this:

{% assign vis_config = '{ vis config details }' %}

Also, can you confirm what you mean when you say “keep the VIS keyword while copying the escaped string”? 

Thanks again!

Thanks for your reply. 

What I mean with the VIS keyword is this 

&vis={

that sentence is on the string on step 10 , when going to LookML do I want to keep that sentence along with the config details, or just the config details.
 

Thank you for the help.

Hi @Beto thank you for clarifying!!  For step 10, you can replace the 

this is where you enter the vis config details with the vis config. The text this is where you enter the vis config details  only demonstrates where to place the vis config details.


I hope that helps - please let me know if you have any other questions!

Userlevel 1

@lauren.boltz  Tried doing the same thing and i get a 404 error

Below is how my lookml looks like , can you let me know what i am doing wrong here?

link: {
      label: "Show as bar graph"
      url: "
      {% assign vis_config = '{\"x_axis_gridlines\":false,\"y_axis_gridlines\":true,\"show_view_names\":false,\"show_y_axis_labels\":true,\"show_y_axis_ticks\":true,\"y_axis_tick_density\":\"default\",\"y_axis_tick_density_custom\":5,\"show_x_axis_label\":true,\"show_x_axis_ticks\":true,\"y_axis_scale_mode\":\"linear\",\"x_axis_reversed\":false,\"y_axis_reversed\":false,\"plot_size_by_field\":false,\"trellis\":\"\",\"stacking\":\"\",\"limit_displayed_rows\":false,\"legend_position\":\"center\",\"point_style\":\"none\",\"show_value_labels\":false,\"label_density\":25,\"x_axis_scale\":\"auto\",\"y_axis_combined\":true,\"ordering\":\"none\",\"show_null_labels\":false,\"show_totals_labels\":false,\"show_silhouette\":false,\"totals_color\":\"#808080\",\"type\":\"looker_column\",\"defaults_version\":1,\"hidden_fields\":[\"psl.sum_mkt_val\",\"Date.TodaysDate_date\"]}' %}
     {{link}}={{ vis_config | encode_uri}}&toggle=dat,pik,vis&limit=5000 "
      
  }

 

This is how when i use the drill down and link fields the url is being passed

lookerinstance/looks/99&vis_config=%22x_axis_gridlines%22:false,%22y_axis_gridlines%22:true,%22show_view_names%22:false,%22show_y_axis_labels%22:true,%22show_y_axis_ticks%22:true,%22y_axis_tick_density%22:%22default%22,%22y_axis_tick_density_custom%22:5,%22show_x_axis_label%22:true,%22show_x_axis_ticks%22:true,%22y_axis_scale_mode%22:%22linear%22,%22x_axis_reversed%22:false,%22y_axis_reversed%22:false,%22plot_size_by_field%22:false,%22trellis%22:%22%22,%22stacking%22:%22%22,%22limit_displayed_rows%22:false,%22legend_position%22:%22center%22,%22point_style%22:%22none%22,%22show_value_labels%22:false,%22label_density%22:25,%22x_axis_scale%22:%22auto%22,%22y_axis_combined%22:true,%22ordering%22:%22none%22,%22show_null_labels%22:false,%22show_totals_labels%22:false,%22show_silhouette%22:false,%22totals_color%22:%22%23808080%22,%22type%22:%22looker_column%22,%22defaults_version%22:1,%22hidden_fields%22:%5B%22psl.sum_mkt_val%22,%22Date.Todays_date%22&toggle=dat,pik,vis&limit=5000

 

Hi @sri75 !! Thanks for the comment! I’m going to cc @wonkyoung.park, the content creator for this post to see if we can figure this out!

Userlevel 1

Hi @sri75 !! Thanks for the comment! I’m going to cc @wonkyoung.park, the content creator for this post to see if we can figure this out!

Hey Lauren, I figured it out. Looks like the custom drilling works only with measures and not dimensions. 

Userlevel 1

@lauren.boltz  @wonkyoung.park, One thing i did oberve here is that when i make a pivot on the second chart for some reason it just doesnt work. I tried multiple charts like bar/column/multiple pie but none of them bring me back the results. If i hit explore from here from the pop up i can still see my chart . 

Below is a sample of my code:

link: {
      label: "Column Chart"
      url: "
      {% assign vis_config ='{ \"x_axis_gridlines\":false,
\"y_axis_gridlines\":true,
\"show_view_names\":false,
\"show_y_axis_labels\":true,
\"show_y_axis_ticks\":true,
\"y_axis_tick_density\":\"default\",
\"y_axis_tick_density_custom\":5,
\"show_x_axis_label\":true,
\"show_x_axis_ticks\":true,
\"y_axis_scale_mode\":\"linear\",
\"x_axis_reversed\":false,
\"y_axis_reversed\":false,
\"plot_size_by_field\":false,
\"trellis\":\"\",
\"stacking\":\"normal\",
\"limit_displayed_rows\":false,
\"legend_position\":\"center\",
\"point_style\":\"none\",
\"show_value_labels\":false,
\"label_density\":25,
\"x_axis_scale\":\"auto\",
\"y_axis_combined\":true,
\"ordering\":\"none\",
\"show_null_labels\":false,
\"show_totals_labels\":false,
\"show_silhouette\":false,
\"totals_color\":\"#808080\",
\"type\":\"looker_column\",
\"defaults_version\":1 '} %}
{{link}}&vis_config={{ vis_config | encode_uri}}&pivots=SecurityClassifications.barl4_indust_name&toggle=dat,pik,vis&limit=5000&column_limit=15"

Reply