Hey guys,
I have an embedded dashboard and want to provide a specific date range as a parameter.
Eg: “2019-02-02” -> “2020-02-02”
I know that i can use the following strings a parameter for a date type filter:
“thisyear”, “lastyear”, “past2years”, etc…
But how do I provide date range? With a “from” date and a “to” date?
Thanks for your help!
Björn
Hi @bjoernhasse
It depends on which type of date filter you have created (and depends on the question type/filter too).
A "Date Range" (or "All Options") would look like this:
/dashboard/1?date_range=2019-02-02~2020-02-02
Thanks a lot @flamber . That really helped.
I was looking through the documentation before asking but couldn’t find anything on how the date range params work.
Am I missing anything in the docs?
Shall I add some documentation to the embedding guide?
## Embedding Metabase in other applications
Metabase includes a powerful application embedding feature that allows you to embed your saved questions or dashboards in your own web applications. You can even pass parameters to these embeds to customize them for different users.
### Key Concepts
#### Applications
An important distinction to keep in mind is the difference between Metabase and the embedding application. The charts and dashboards you will be embedding live in the Metabase application, and will be embedded in your application (i.e. the embedding application).
#### Parameters
Some dashboards and questions have the ability to accept parameters. In dashboards, these are synonymous with dashboard filters. For example, if you have a dashboard with a filter on Publisher ID, this can be specified as a parameter when embedding, so that you could insert the dashboard filtered down to a specific Publisher ID.
SQL based questions with template variables can also accept parameters for each variable. So for a query like
```
SELECT count(*)
FROM orders
WHERE product_id = {% raw %}{{productID}}{% endraw %}
This file has been truncated. show original
@bjoernhasse
I don’t understand. Date range works similar to single date or relative date - it’s a parameter with one value - though a specific format, but so is single and relative dates.
But if you think something is missing or difficult to understand, then you are welcome to open a PR.