We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

How to create a date range interactive filter for dashboards?

Dario Marquez
Tera Expert

I need to create an interactive filter that allows me to set in between dates in a dashboard. Similar to the date filter currently exists in standard reporting but in a widget that I can add to a dashboard. I don't need the time, just the dates. So far I've found only 1 script in the community with an update set that creates a macro and a widget, but didn't work for me. Does anyone have a different script or update set that can help me create this filter? find_real_file.png

1 ACCEPTED SOLUTION

Hey, this worked for me. The update set is a combination of 2 contributions based on this post:

Interactive Filter "between dates"

Basically the update set creates:

  • a new widget called "custom interactive filter"
  • and a UI macro, which is the backend magic that works with the new widget created

the widget coding is originally from the accepted solution from the mentioned post, but the macro part doesn't work, so the macro fixed code was posted in a later reply (that for some reason I am not able to find). But the macro displayed text was in Norway language, so I had to translate it. 

So the final update set is like a hybrid solution compiled in the attached update set, which should give you something like pic below. You will only need to update the table names  in the widget coding(pic 2), everything is explained in the linked post. So at the end you will have one filter for each table needed.  Let me know any questions.

find_real_file.png

pic2

find_real_file.png

 

View solution in original post

68 REPLIES 68

Hi @Dario Marquez ,
Thanks a lot for such solution which makes our work easier.
Could you please help me on query.
I need to update two  reports using only one widget. Like if we will select the filter condition in Incident Opened Date Filter',  it will update 2 reports, one created based on Incident and another on Incident_sla  having field opened_at inc_opened_at.


Hi Kaushik, unfortunately I do not know how to make a single widget filter to work on multiple tables. I would guess that it may be achievable by modifiying the code on the 'custom interactive filter' widget. But I am afraid I am not that technical, sorry. The only way currently is to have a widget for each table.

Hi @all 

Could you please help me on the above query ?

Hi Dario,

 

It works perfectly on the core tables. However, is there anyway to make it work on Database views as well.

Hey Dario. Is there a way we can give default values to 'from start date' & 'to end date' that will appear on the selection of between? @Dario Marquez