Time to first response for issues without certain labels

Hi,
I am trying to create a report with [Time to first response Issues] for issues that not contain certain labels. I have created a Calculated Member with these labels ([Label].[Specific labels]).
I have found that this Calculated Measure works in my test environment:

Sum(
Filter(
Descendants([Issue].CurrentMember, [Issue].[Issue]),
IsEmpty(
([Label].[Specific labels],
[Measures].[Time to first response Issues]) )
),
[Measures].[Time to first response Issues]
))

My problem is that when I implement it in the production environment (with more than 120000 issues in the project), I get a time out and is asked to simplify the calculation.
I have tried but I don’t have enough knowledge to do it.
Can anyone help me?

Hi @hedmaeli

120k issues is challenging number of issues in account if you use a formula with Descendants function that goes through “Issue” dimension members.
here, the best would be using a Javascript code in advanced settings to precalculate the results during import. Then you can import this new precalculated field as dimension and filter the results without using Descendants function

Try this Javascript for the calculated field:

[jira.customfield_donotreport]
name = "Do not report"
data_type = "string"
dimension = true
javascript_code = '''
var labellist = ["label1","label2"]; 
var newlist = new Array;
if (issue.fields.labels){
issue.fields.labels.forEach(function(label){
if (labellist.indexOf(label) != -1 ) {
var dnr = newlist.push("Yes");
}
})};
if(dnr)
  {
    issue.fields.customfield_newlabel = "Yes"
  }
'''

That would create a new calculated field “Do not report” with value “Yes” if the issue has one of defined labels (label1 or label2). Once this field is imported as dimension, you could select the value “(none)” from the new dimension and use it with the measure “Time to first response issues” and it should work fast enough with 120k issues in the report.

Martins / eazyBI support

Thanks for the solution!
I had to do some more changes, more than changing labels, to get it to work. Finally I managed.
One problem I have is that I found some more labels that I didn’t have in the javascript from the beginning. It seems like it didn’t help to change the script and then do an import. Do I have to re-import all data to get the changes imported?

br /Elisabet

Hi,

Yes, you would need to reimport the data if you changed the Javascript definiton
https://docs.eazybi.com/eazybijira/data-import/jira-issues-import#JiraIssuesImport-Re-importalldata

Martins / eazyBI support