There are a couple of ways how to calculate the number of issues created outside office hours.
First, let us look at an example to find issues created before 9 am or after 6 pm in eazyBI.
To do this, you can define a created hour breakdown dimension with advanced settings:
[jira.customfield_hodc]
name = "Hour of Day Created"
data_type = "integer"
dimension = true
javascript_code = '''
issue.fields.customfield_hodc = parseInt(issue.fields.created.match(/T(\d\d):/)[1]);
'''
Further, select the new dimension for import from the data import screen as a new dimension. You will be able to create the following report and even highlight the most active and passive times of the day:
Further, you can create a calculated member in Measure that sums the total issues created outside working hours (before 9 am and after 6 pm):
Sum(
Filter(
Except([Hour of Day Created].[Hour of Day Created].Members,
[Hour of Day Created].[(none)]),
Val([Hour of Day Created].CurrentHierarchyMember.Name) < 9 OR
Val([Hour of Day Created].CurrentHierarchyMember.Name) >= 18
), [Measures].[Issues created])
Secondly, there is another option without importing the additional Created hour dimension. While this would also work for hours only, this approach can be slower and is suggested only if the working hours are not full, e.g., 9 AM to 5:30 PM.
In such a case, please create a new calculated member in the Measures dimension using the following code:
NonZero([Measures].[Issues created] - -- total created issues minus created during working h
Count(Filter(
Descendants([Issue].CurrentMember, [Issue].[Issue]),
DateInPeriod(
[Issue].CurrentMember.get('Created at'),
[Time].CurrentHierarchyMember) AND -- created date in the period
[Measures].[Issues created] > 0 AND -- issue is created in selected report context
((Hour(DateParse([Issue].CurrentMember.get('Created at'))) >= 9 AND -- created hour is after 9
Hour(DateParse([Issue].CurrentMember.get('Created at'))) < 17 -- created before 17
) OR (
Hour(DateParse([Issue].CurrentMember.get('Created at'))) = 17 AND -- if the hour is 17
Minute(DateParse([Issue].CurrentMember.get('Created at'))) < 30 -- then created is before 17:30
))
)))
Cheers!