Using URL parameters to filter start and end date
Hello!
I have a trend / line chart whose start_date and end_date filters I'd like to control through URL parameters, such as ¶meter.start_date=1970-01-01¶meter.end_date=2023-02-07.
I don't see an option to use parameters for filters of type date.
Any suggestions on how I achieve the desired effect?
Thank you!
-
Hi Dan Balaban
I'm truly sorry for this late reply but the system for whatever reason filtered out your message.
it's true that apparently you cannot use parameters with date/timestamp datatypes, but defining the parameter as custom and using a custom filter is going to do the work.
create two custom parameters called start_date and end_date, defining a default values like '1970-01-01' and '2058-31-12'
In the object or in the filter panel and Create a SQL Filter
write a sql expression e.g. starttime between date '${start_date}' and date '${end_date}'
And apply the filter.
Now you can apply your custom filters using the values you specify in the URL e.g.
https://localhost:6273/heavyai/dashboard/2?tab=-MvXehh9cf7ueJPtEYrT¶meter.start_date=1970-01-01¶meter.end_date=2015-02-07
If you define the filter in the datasource all the datasource will be filtered for the values you specified, while if specified at chart level, only that chart will be filtered
I hope this helps,
Candido
Please sign in to leave a comment.
Comments
3 comments