I have a dashboard with an organization filter on it and I am wondering based on the organization that users select, whether I can write something like this in my sql-derived table. Basically, each organization has a different max date and I want to only output the data that is from that max_date like so:
Steps:
** Dashboard user selects Organization A on the dashboard **
My sql-derived table:
WHERE date(run_time) = (select max(date) from table where organization_name = {{ _filters['viewname.value'] }})
..where {{ _filters['viewname.value'] }}) equals Organization A, the org that the user selected in the dashboard filter.
^ the above is obviously not working but I hope it shows what I’m trying to do.
Solved! Go to Solution.
Hello!
Yes, this can be done. First you have to create a filter in the view file. This filter will appear in the explore just as any other dimension or measure. You can then apply a dashboard filter to this filter in the view.
By using this syntax:
You can read about it here: https://docs.looker.com/reference/field-params/filter
Hello!
Yes, this can be done. First you have to create a filter in the view file. This filter will appear in the explore just as any other dimension or measure. You can then apply a dashboard filter to this filter in the view.
By using this syntax:
You can read about it here: https://docs.looker.com/reference/field-params/filter