Get Free Trial

Saved report filters on empty datetime values.

Answered
Travis Bean asked on July 28, 2022

We are having an issue when users save reports that have date columns filtered to remove empty values. Whenever the user reloads the report the filter is ignored because Flexmonster believes the member is invalid: 

Error in predefined filter or members have not been loaded yet:

The filter can be reapplied manually through the UI and it utilizes the same filter string that was previously invalid with no issues. 

{
filter: {
exclude: [
'next_future_or_past_task_due_date.[]'
]
},
uniqueName: 'next_future_or_past_task_due_date'
}

While testing this issue I created a simple button that when clicked triggered the following function: 

private addFilter() {
this.$refs.pivot.flexmonster.getMembers('next_future_or_past_task_due_date', '', (members: any) => {
console.log(members[0]);
});
this.$refs.pivot.flexmonster.setFilter('next_future_or_past_task_due_date', {
exclude: [
'next_future_or_past_task_due_date.[]'
]
});
}

the console logs the first item in the member array which comes out as

{
"uniqueName": "next_future_or_past_task_due_date.[]",
"caption": "",
"dimensionName": "next_future_or_past_task_due_date",
"hierarchyName": "next_future_or_past_task_due_date",
"hierarchyCaption": "Next Future (or Past Due) Task Due Date",
"parentMember": "next_future_or_past_task_due_date.[(all member)]",
"isLeaf": true,
"children": []
}

and then immediately tries to use setFilter() to set a filter that excludes that member and we still get the:

Error in predefined filter or members have not been loaded yet:

Again, using the built in UI to set the filter works, it’s only when saving the filter and then reloading the report, or trying to set it using the setFilter() method do we get that error. 

using a workaround like query filters doesn’t solve the issue because the filters are not saved as queries when users filter using the UI, and users may decide to filter against multiple dates as well which means query will not work. 

Thanks for any assistance in this matter! 

Sincerely, 
Travis Bean

3 answers

Public
Maksym Diachenko Maksym Diachenko Flexmonster July 29, 2022

Hello, Travis!

Thank you for writing to us.

Our team could not reproduce this issue and was able to set a similar filter (please see the JSFiddle for reference). We suggest updating Flexmonster to the latest version since our team fixed similar issues in previous versions. If updating to the latest version doesn’t resolve the issue, please let us know which datasource type you are using or modify this JSFiddle to make the issue reproducible.

Looking forward to hearing from you.

Best Regards,
Maksym

Public
Travis Bean July 29, 2022

Hello, Maksym

Thank you for the response, updating did fix the issue we were experiencing. I appreciate the help! 

Regards,
Travis Bean

Public
Maksym Diachenko Maksym Diachenko Flexmonster August 1, 2022

Hi, Travis!

We are glad to hear that updating the component helped to solve the issue.
Feel free to contact us if other questions arise.

Best Regards,
Maksym

Please login or Register to Submit Answer