Forum Discussion
HI HamzaJ
I actually created custom action due to issue with level not changing , and this is working pretty good as long as no one is changing date filter type from 'Time frame' to something else like 'List'
let itemArr = prism.activeDashboard.filters.$$items;
let OurFilter = itemArr.find(function (x) {
return x.jaql.title === payload.filterName
});
OurFilter.jaql.level = payload.level;
OurFilter.jaql.filter.last.count = payload.count;
OurFilter.jaql.filter.last.offset = payload.offset;
payload.widget.dashboard.refresh();
I was going to go ahead with your suggestion but I am having a problem with setting up this reset button. The code you provided changes type of date filter to list so my action stops working. Do you have idea what I can change in action or reset button to make it work ?
Hi Wojtek
You could try the following code. This works for me. Do change the level to the according datelevel that you are using (and the table/column field). If you are using months and you let it set on years, it will add another date filter on year-level instead of resetting the month-filter. Just so you know.
{
"type": "Filters",
"title": "Filter (by Dimension)",
"data": {
"filters": [
{
"filterJaql": {
"explicit": false,
"multiSelection": true,
"all": true
},
"dim": {
"title": "Year",
"table": "Projects",
"column": "CreatedAt",
"datatype": "datetime",
"level": "Years"
}
}
]
}
}