Setting Advanced Date Filter as Default Filter but Allowing Viewers to Change Date as Needed

Comments

12 comments

  • Avatar
    Andrew Block

    Kendrick, do you need an advanced filter for this? Couldn't you just use the Last 12 month as a time frame filter on your date dimension?

    0
    Comment actions Permalink
  • Avatar
    Kendrick Powell

    That would be great but there isn't a last 12 months in the time frame filter. Is there a way to add that to the time frame filter? 

    0
    Comment actions Permalink
  • Avatar
    Iris Maessen

    The custom radio button filter looks interesting, but I would like to give my users the regular calendar selection options. Only when the dashboard is first loaded, I would like it to load with a custom range. Right now, if I define a custom range on my dashboard in an Advanced filter and share it with viewers, the viewer can only edit the JAQL of the Advanced filter. If I had shared it with one of the default Calendar options, all Calendar selections (List, Calendar, Time Frame) would be available to my viewers.

    Iris

    0
    Comment actions Permalink
  • Avatar
    Roopa Raghavan

    Iris & Kendrick,

    What approach are you guys following to this end? I have the exact same need - need a custom date filter (I'm trying to offset last 7 days by 1 day) and when this is done via advanced edit option, viewers dont have the option to choose any of the other default date options like this month, last month, last 2 months etc. 

    @Michael Becker - it was good to meet you at Eureka 2019. we did have the custom Timeframe filter implemented worked good too and I'm able to set offsets like I want/change verbiage to past 2 days etc, but I think we wanted to go with the regular date filter that is available.

    Any ideas on how to edit the filter script is appreciated!

    Thanks.

     

    0
    Comment actions Permalink
  • Avatar
    Iris Maessen

    At this point, I'm not getting around this. My users quite often use the calendar selection option to select quite specific time ranges that I can't predefine, so I can't really give the a useful range of options with a custom filter. I use the standard filtering options on all of my dashboards except one, where showing a particular period is more important than being able to select any given period. Even for that one, I'm close to redesigning the dashboard so I can use the standard filters. (Also because one of the plugins I'm using interferes with the advanced date filter so it's not adjustable at all).

    0
    Comment actions Permalink
  • Avatar
    Michael Becker

    Hi Iris,

    have you considered this - https://support.sisense.com/hc/en-us/community/posts/115009381008-Filter-Buttons-Widget ?

    You should be able to get last 13 months, and at the same time have standard filter with calendar in the filter pane. Probably needs testing.

    @Roopa - It was nice chatting to you too :) Can you elaborate a little about editing script? I'm more than happy to jump on a quick call to review this.

    Regards,

    Michał

    0
    Comment actions Permalink
  • Avatar
    Ravid Paldi

    Iris & Kendrick,

     

    If I understand correctly your issue is:

    - You wish to give user the flexibility of using the native date filter options

    - You also want them to be able to select dates that are only within the last 12 months (or any other particular period)  

     

    If that is the case, you can do a similar trick to what Michal had suggested with the "Customized Timeframe Radio Buttons. 

    What you should is:

    - You can add a custom column named "LastYeatFlag" into the table that holds the data where that field will be 1 if the date is within the past 12 months and 0 if otherwise. 

    - Add a hidden/locked filter to your dashboard for that new custom field. 

    - The end result will be that the data in the dashboard will be only for the past 12 months and the user will still be able to filter out specific dates within that range. 

    Fill free to reach out if you need further assistance 

    ravid@paldi.solutions 

     

    Good luck (: 

    0
    Comment actions Permalink
  • Avatar
    Iris Maessen

    @ravid that is not quite  what I want -- I want to predefine 'standard' time period selections which are different from the *actual* Sisense standard ones, but still allow my users to make their own selections based on the calendar if they want to. (the original poster wanted 12 months -- what I want is more in the days or weeks range). Right now, I cannot present 5 weeks by default but allow people to change that through the calendar (including to periods beyond those 5 weeks). It has to be through the advanced filter.

    Predefining other timeperiods is definitely possible, but that then disallows the calendar filter. Michael's suggestion above is one I'd have to investigate, but it would mean putting the filter on the dashboard as a widget instead of as a filter. And it's another (unsupported?) plugin.

    2
    Comment actions Permalink
  • Avatar
    Kendrick Powell

    Iris 

    What I was trying to do was to create a compare to date filter.  The solution I came up with on that was to create two widgets and two date filters. Then have one widget point to one date filter and the other point to the other date filter. 

    It sounds like this is a little different from what you are trying to do. What I have done on my dashboards that need a certain date range when opening is just publish it with that date range. In your situation I can see how that will not be very pleasing to the eye to have the filter open up to a custom filter though. 

    You can also save it as the default filter which is in the menu above the filter pane. This will save that filter even when viewers change it. Then if they want they can hit the refresh button above the filter pane and that will take them back to your custom filter.  

    Another idea an I haven't attempted this so if you try it let me know if it works. In the elasticube create a table that brings in the last five weeks of dates.  Then use that table for a filter for the last five weeks and use your normal date filter for users to search what they need. In this case the user would need to turn off the five week filter to run their custom date range and visa versa. Both filter can't be turned on at once or they would work against each other. 

    I am not sure if this helps at all but let me know either way and I will keep thinking through it.  

    0
    Comment actions Permalink
  • Avatar
    Ravid Paldi (Edited )

    Hi @Iris,

    If that's the case then @Michael's suggestion is a great one and most definitely the simplest one.

    Either way, solving this will require some level of JS intervention so if using a plugin that's not officially supported is a concern you can minimize the JS intervention by adding to the dashboard some custom script code that:

    1) Fires on the dashboardloaded event,

    2) Calculate the specific date of 5 weeks ago (today's date minus 35 days)

    3) Update the filter with the specific dates rather then letting Sisense calculate them (=using a custom filter)

    * I'll try to find sometime soon and write that snippet for you if needed. 

    * If you need it to happen on multiple dashboards, I advise to move that logic to a plugin and keep a mapping of the dashboards IDs that should be affected by it. 

    1
    Comment actions Permalink
  • Avatar
    Aleksandar Sargic

    I'd like to vote up this request as well. This is a common enough feature that should be considered as a future enhancement. 

    I think the request is when a calendar filter is pulled up, we should be able to set custom formula in the From and To fields. 

    For example I can set that default value for From field is 1st day of the previous month and default value for To field is last day of the previous month (basically imitating last month logic, but it's a lot more flexible because you can set last 7 months, etc). 

    The dashboard applies the default values upon load, but the viewer is free to change those values in the calendar without jumping through hoops. 

    0
    Comment actions Permalink

Please sign in to leave a comment.