Html to link to custom explore?

  • 3 July 2018
  • 1 reply


I have a measure that I want to link out to an explore with custom filter settings. We have a dev and prod environment setup for our use case. I elected to use something like this:

measure: sum_count_tickets { html: <a href="">{{value}}</a> ;; }

From the html docs, I haven’t seen any way to dynamically set the portion based on the environment I am using this. Any suggestions here?

1 reply

Userlevel 2

Hey @ajhong91 ,

You should be able to achieve this with user attributes and liquid. The steps are:

  • create user attributes called “domain” in both instances and assign them different default values

  • build the link in sections by prepending the protocol to the domain and appending the resource path to the protocol/resource path

  • finish up by appending the fields and filters in the href attribute

dimension: zip {

type: zipcode

sql: ${TABLE}.zip ;;


{% assign dynamic_domain = _user_attributes['domain'] | prepend: "https://" | append: "/explore/ecom/users_new" %}

<a href="{{ dynamic_domain }}?[]={{ _filters[''] | url_encode }}" >{{value}}</a> ;;