Question

Links with date filter between two dates

  • 9 January 2018
  • 2 replies
  • 689 views

Userlevel 1

I’m trying to set up links with a dashboard to reload the dashboard filter by various metrics, most of this I have working fine, however the dashboard has a date range (e.g. the url string looks like &Date=2018%2F01%2F01%20to%202018%2F01%2F09 for 2018-01-01 to 2018-01-09). How would you go about passing this through in liquid in the link?


The code I’m trying looks something like this:-


url: "/dashboards/69?Agent={{ _filters['agent_customer_demographics.Agent'] | url_encode }}&date={{ _filters.['agent_customer_demographics.application_date'] | url_encode }}&Gender={{ value }}&Age={{ _filters.['agent_customer_demographics.Age'] | url_encode }}&Location={{ _filters.['agent_customer_demographics.Location'] | url_encode }}"


Where application_date is the column that I’m filtering the range by. This isn’t working though, and the default range is being applied when I click the link (the other filters are being passed through fine).


Is this something that can be achieved?


2 replies

Userlevel 3

Hey Matthew,


I would recommend removing the period between _filters and ['agent_customer_demographics.application_date']. The parameter for filters is _filters['view_name.field_name'], which you can read a bit about here. I did some testing locally and was able to pass in the full range using

&date={{_filters['view_name.field_name'] | url_encode }}.


Ryan

Userlevel 1

Hi Ryan,


Thanks for getting back to me; in the case I had, it was because the filter was on application_date_date as a dimension group; changing to this got things working.


Thanks


Matthew

Reply