I am trying to create a dynamic filter to use in a dashboard. Ideally when the user selects a value from the Filter Selector filter the values in the Dynamic Filter filter would change accordingly. For example, if the value “Age” is selected from the Filter Selector filter the value in the Dynamic Filter filter would be 10,20,30 etc, similarly when another value is selected in the Filter Selector filter the values in the Dynamic Filter filter should change accordingly. Below is my LookML,
When I select the “Age” value in the Filter Selector filter I am seeing the values for “Race” in the Dynamic Filter filter instead of the values for “Age” . The appropriate values (based on the value selected in Filter Selector filter) are not showing up in the Dynamic Filter.
No sure where I am messing up things in my LookML code. Can someone please help?
First you’ll need to make a slight change to how you’re utilizing the parameter in your dynamic dimension - modify it to use this syntax for referencing the parameter values:
You’ll also need to modify your parameter filter in the dashboard to “Select filters to update when the filter changes” so that the suggestions reload when you change the parameter value:
Last note is that you’ll need to make sure that “Age” is a string so that suggestions are actually shown in the filter - number type dimensions will not have suggestions.
Thanks a lot @Zach_A Much appreciated! Works like a charm!
I have a quick question regarding your comment Last note is that you’ll need to make sure that “Age” is a string so that suggestions are actually shown in the filter - number type dimensions will not have suggestions.
What can I do if the value in the dimension_selector parameter is of a number or datetime datatype other than string datatype? For example in my case I would want to use the field “Date Of Birth” which is of type: time & datatype: datetime as a part of the parameter dimension_selector and dimension: dynamic_dimension. Below is the LookML of the “Date OfBirth” dimension_group
dimension_group: DateOfBirth {
type: time
datatype: datetime
label: “Date Of Birth”
timeframes: [raw,time,date,week,month,quarter,year]
sql: ${TABLE}.DateOfBirth ;;
}