At LookML dashboards, the listen parameter of the elements is a one-to-many mapping, but it would be extremely useful to my use case to associate one filter to more than one field. Is there anyway to achieve the same result without the need to replicate the filter?
Like you said - the "listen" element can be used on several dashboard elements, and can reference the same filter. Sounds like exactly what you're looking for - what am I missing here?
I want to reference the same filter multiple times on the same element, for different fields.
Example:
- title: Element1
name: Element1
[...]
listen:
DateFilter: date_field1
DateFilter: date_field2
[...]
I wanted to do it this way so we could use the same dashboard filter for a filter-only field (https://cloud.google.com/looker/docs/reference/param-field-filter_ ) and for a dimension. Is this possible?
Ah, I see what you mean. No, I don't think it's directly possible to filter on two fields in the same tile with the same dashboard filter.
Can you tell me more about your use case? You may be able to achieve your goal with templated filters in Liquid. For example, you could write some SQL into your filter-only field that would capture any logic applied to date_field1.
filter: date_field2 {
type: date
sql: {% condition date_field1 %} ${TABLE}.date_field2 {% endcondition %};;
}
We tried this approach, but when we try to get the "value" of the filter on other Liquid expressions, it fetches the SQL expression, and not the actual value anymore. Is this expected or am I getting something wrong? Thank you in advance for the help.
Different liquid variables return different values.
See the Liquid variable reference for more details!