-
1. Re: Create last 7 days, last 14 days, last 28 days etc. drop down filter for dashboard
Zhouyi ZhangJun 29, 2018 4:37 AM (in response to Edward Walker)
Hi, Edward
Another alternative way is to use parameter instead of filter, and create calculation dealing with the dates.
ZZ
-
2. Re: Create last 7 days, last 14 days, last 28 days etc. drop down filter for dashboard
eva_lesny Jun 29, 2018 4:58 AM (in response to Edward Walker)I'd use a parameter.
Make the parameter an integer and then either a list (for example: value: 7; display as: "Last 7 days") or a range (or no range at all) so the user can choose on his own how many past days he wants to see.
Then make a calculated field:
[Order Date] > DATE(DATEADD('day', -[Parameters].[Last N Days], [Set Date] ))
and [Order Date] <= [Set Date]
[Order Date] is the field that you want to be filtered
[Set Date] should be the latest date in your data set (you could make another parameter where the user can select to which date he wants to see the last N days)
Now it depends on your data. If you want it to be filtered relative to today you can use today() instead of set Date.
Otherwise you'll need to use a fixed expression, something like {max([Order Date])}.
If you filter by something else though you might need to put these fields in context so that the maximum Date is relative to what you have in the view.
Then you can put this new field on filters and set it to true
-
3. Re: Create last 7 days, last 14 days, last 28 days etc. drop down filter for dashboard
Edward Walker Jun 29, 2018 8:08 AM (in response to eva_lesny)Thanks Eva, that did exactly what I was after!