Forum Discussion
I don't have background filters set on this current filter, what is happening is the se.filters.update(datefilter, filterOptions) command is altering all my other filters, and any with backround filters set are gettin gmessed up. I just need to code to touch filter "Date" and thats it
Since we added below line of code, it should filter to only 'Date' filter.
filter = se.filters.$$items.find(el=>el.jaql.title == 'Date')
Are you using same script as above? If possible, can you share the script you are using, so that I can try to replicate the issue.
-Hari
- jplefka08-12-2022Data Storage
Since 'm using older data in my DEV environment the latest date i have is from June so i'm hard coding it for now
dashboard.on('initialized', function (se, ev) { currentYear = '06/01/2022' datefilter = se.filters.$$items.find(el=>el.jaql.title == 'As Of Month') datefilter.jaql.filter = { "explicit": true, "multiSelection": false, "members": [currentYear] } var filterOptions = { save: true, refresh: true, } se.filters.update(datefilter, filterOptions) });
- harikm00708-12-2022Data Warehouse
This is interesting. I tried the same code and it works for me (I have 2 more dashboard filters with background filter and locked filter). Are you using any other dashboard script? Also can I ask screenshot of filter panel after executing this script?
-Hari
- jplefka08-12-2022Data Storage
No this is the only script i'm using, here is the before and after