App selectable date range in analytics


I wanted to ask if there is a way, to have analytics with movable date range?
E.g. ,

I have analytics showing values “a” and “b”, with period of time, let say, 1 week. I would like this 1-week date range to be selectable from the app level. Like in this example:

On analytic we show relation of the harvested number of apples with number of people collecting them. For now, the supervisor needs to see how many apples have been harvested daily by one shift in 1st week of October, but he would like to have a button in app showing previous week (and he might fancy a button showing forecast for the upcoming week on top of that :smiley: ) .

Is there a smart way to do that, or I would have to generate analytics for each week separately?
How to set date range, so it would not be fixed, but would be changing dynamically, for lets say, last 4 weeks , to be shown week by week?

Thanks for you information.

Hi @tswietochowska - great question!

I think the best way this can be done is as follows:

  1. Create your analysis to include all time for the date range
  2. Add this analysis to your app
  3. Create a “start date” variable and an “end date” variable using the date picker input widget
  4. Dynamically filter you analysis in app by the start and end date variables

    Then whatever date range is entered, the analysis will be updated to reflect the data in that range!

If you wanted to have fixed time period (for example, 1 week prior to current date) you could use a button with an expression to do “app info.current date and time - (7* 24* 60* 60)”

let me know if this helps!