How can I use a series of cascading filters in a dashboard and allow some of them to take a value in the liquid variable hyperlink, while some filters allow null values?
The first dashboard a user visits in a series of 4 has 13 separate filters. Once chosen, those filters need to affect the next dashboard my user visits - so they won't have to re-choose their department and week of interest over and over.
We also wanted icon tabs to link to the next page/dashboard. Those tab icons are built as LookML dimensions that carry the hyperlink with filters for that dashboard.
I've used liquid variable filters with 2 values but never with this many. It was a challenge and required some time chatting with Looker support. Initially, the filters were forcing a value into each of the 13 available instead of leaving nulls where no filter value was set. The week filter is my original liquid filter methodology, and the others are done in such a way that they don't force a value entry.
In this case, I was making a linked image to use as a tab button on the left side of every dashboard (shown in a single value tile), so the image is created as a dimension here with a liquid filter in the html.
dimension: image_name{
type: string
sql: "this is string";; # what you put on this sql line does not affect anything
#important for the first filter to continue on the same line as the dashboard link - no return after the "?"
html: <a href="https://ourinstance.looker.com/dashboards/17?week={{ date.fyfwid_wkend._value | url_encode }}
&company={{ _filters['dept.company'] | url_encode }}
&concept={{ _filters['dept.concept'] | url_encode }}
&concept%20445={{ _filters['dept.concept_445_desc'] | url_encode }}
&division={{ _filters['dept.division_desc'] | url_encode }}
&zone={{ _filters['dept.zone_desc'] | url_encode }}
®ion%20L3={{ _filters['dept.region_l3_desc'] | url_encode }}
®ion%20L2={{ _filters['dept.regionl2_desc'] | url_encode }}
®ion={{ _filters['dept.region_desc'] | url_encode }}
&district={{ _filters['dept.district_desc'] | url_encode }}
&branch={{ _filters['dept.branch_desc'] | url_encode }}
" >
<img border="0" alt="altText"
#image must be hosted online in order to use on your Looker dashboard
src="https://imagelocation.s3.amazonaws.com/media/visual/customthumbnail/A9216073268B146A.png"
height="30" width="45">
</a> ;;
}
We also wanted icon tabs to link to the next page/dashboard. Those tab icons are built as LookML dimensions that carry the hyperlink with filters for that dashboard.
I've used liquid variable filters with 2 values but never with this many. It was a challenge and required some time chatting with Looker support. Initially, the filters were forcing a value into each of the 13 available instead of leaving nulls where no filter value was set. The week filter is my original liquid filter methodology, and the others are done in such a way that they don't force a value entry.
In this case, I was making a linked image to use as a tab button on the left side of every dashboard (shown in a single value tile), so the image is created as a dimension here with a liquid filter in the html.
dimension: image_name{
type: string
sql: "this is string";; # what you put on this sql line does not affect anything
#important for the first filter to continue on the same line as the dashboard link - no return after the "?"
html: <a href="https://ourinstance.looker.com/dashboards/17?week={{ date.fyfwid_wkend._value | url_encode }}
&company={{ _filters['dept.company'] | url_encode }}
&concept={{ _filters['dept.concept'] | url_encode }}
&concept%20445={{ _filters['dept.concept_445_desc'] | url_encode }}
&division={{ _filters['dept.division_desc'] | url_encode }}
&zone={{ _filters['dept.zone_desc'] | url_encode }}
®ion%20L3={{ _filters['dept.region_l3_desc'] | url_encode }}
®ion%20L2={{ _filters['dept.regionl2_desc'] | url_encode }}
®ion={{ _filters['dept.region_desc'] | url_encode }}
&district={{ _filters['dept.district_desc'] | url_encode }}
&branch={{ _filters['dept.branch_desc'] | url_encode }}
" >
<img border="0" alt="altText"
#image must be hosted online in order to use on your Looker dashboard
src="https://imagelocation.s3.amazonaws.com/media/visual/customthumbnail/A9216073268B146A.png"
height="30" width="45">
</a> ;;
}
Looker, liquid variable filters, dashboard hyperlinks, icon/image tab buttons

Comments
Post a Comment