Hi @jbran00,
Welcome to the eazyBI community!
There are several ways of finding the relevant issues.
One of the options is to iterate through the Issue dimension and check each issue to see if it has met or breached the SLA. The main drawback for this approach is that this calculation might get slow on larger instances with a high number of issues.
The expression to find the number of issues breaching SLA might be as follows.
Sum(
Filter(
--set of issues
DescendantsSet(
[Issue].CurrentHierarchyMember,
[Issue].[Issue]),
--conditions for filter
--conditon 1 - check relevance against the report context
[Measures].[Issues resolved]>0
AND
--condition 2 - resolved after due date
DateCompare(
--dropping the resolution date time part before comparison so the issue resolved in afternoon is still within due day
DateWithoutTime(
[Issue].CurrentHierarchyMember.Get('Resolved at')),
[Issue].CurrentHierarchyMember.Get('Due date'))>0
),
--numeric value for sum
[Measures].[Issues resolved]
)
An alternative option is to create a JavaScript-calculated custom field dimension that finds the issue SLA category upon data import.
You might define a new field in the source data tab as described here - New calculated fields.
The Javascript code might then be as follows.
if( issue.fields.resolutiondate &&
issue.fields.duedate ) {
var res = new Date(issue.fields.resolutiondate).setHours(0,0,0,0);
var due = Date.parse(issue.fields.duedate);
if(due <= res ){return "Met";}
else{return "Breached";}
}
else
if(issue.fields.duedate) {return "Pending";}
else {return "Undefined";}
This would allow to import the new dimension with the following values:
- resolved earlier or within due date - met
- resolved after due date - breached
- due date present, but issue not resolved - pending
- due date not set - undefined
You might then use the following construction to see the percentage of SLA specifically met issues.
([Measures].[Issues resolved],
[SLA status].[Met])
/
[Measures].[Issues resolved]
Regards,
Oskars. / support@eazyBI.com
PS. JS code updated with necessary corrections.