This post is the continuation of:
The eazyBI team has suggested me a new improved version of the post, the reason is because when we use in rows the dimension Time ( using for example monthly aggregation) the formula doesn’t work as expected.
Example 1: It works
Example 2 (with Time in rows): Doesn’t work as expected.
The proposed solution by eazyBI
—-
The formula you have found is doing a different calculation than you would expect: In case there are resolved issues, it sums all the workdays in transition status for issues that have transferred from the group of unresolved statuses in the period and then dividing it with the resolved issues. Unfortunately, when using Time, these sets of issues are not necessarily overlapping – no point says that we want to sum workdays in transition status only for the issues resolved in this period.
To do so, you would need to iterate through the set of issues, find the ones that are resolved in the period and then sum their workdays in the transition status.
Sum( Filter(Descendants([Issue].CurrentMember, [Issue].[Issue]), DateInPeriod([Issue].CurrentMember.get("Resolved at"), [Time].CurrentHierarchyMember) AND [Measures].[Issues resolved] > 0), ([Measures].[Workdays in transition status], [Transition status].[Unresolved status]) ) / [Measures].[Issues resolved]
Additionally, if you wish to sum the days they have ever spent in the status, not only during this period, you would add the Time.CurrentHierarchy.DefaultMember to the Measure tuple.
Sum( Filter(Descendants([Issue].CurrentMember, [Issue].[Issue]), DateInPeriod([Issue].CurrentMember.get("Resolved at"), [Time].CurrentHierarchyMember) AND [Measures].[Issues resolved] > 0), ([Measures].[Workdays in transition status], [Transition status].[Unresolved status], [Time].CurrentHierarchy.DefaultMember) ) / [Measures].[Issues resolved]
Many thanks to the eazyBI team!! BRAVO! <3<3
By MrAddon
Excellent original article and update, I am very thankful!
LikeLiked by 1 person
I am a little confused by this article. Should I be creating a new calculated measure or changing the one from the first article you said to create? There are no real clear directions as to what I should do here.
Thanks for your help!
LikeLike
I am confused by this article compared to the first one. Do I need to update the original Calculated Measure you said to create in the first article or am I creating a new one?
LikeLike
Hello Mike,
You must create the “Unresolved” Calculated member in Transition-Status dimension.
And ONLY apply the one (or the two) Calculated Measure (In the Measures dimension) proposed by eazyBI
Regards
LikeLike
Hello,
Thanks for writing this blog. I followed the instructions given in this blog to create a Time spent in each status report for all the resolved issues within a given time period.
I get a warning saying
“Do not use the other dimension Transition status when defining a calculated member in Transition Status . Create complex calculations in Measures .”
while creating the calculated member in the Transition status dimension with the given formula as shown below.
[Transition Status].[Unresolved Status] =
Aggregate({
[Transition status].[New],
[Transition status].[In Squad Review],
[Transition status].[Ready for grooming],
[Transition status].[Grooming],
[Transition status].[Groomed],
[Transition status].[Ready for Development],
[Transition status].[In development],
[Transition status].[Ready for Peer Review],
[Transition status].[In Peer Review],
[Transition status].[Ready for testing],
[Transition status].[In Testing],
[Transition status].[Ready for Acceptance],
[Transition status].[In Acceptance],
[Transition status].[Resolved],
[Transition status].[Merged]
})
Is it okay to ignore this warning ?
Then I created a calculated measure “Average Flow Time” as given below (following the steps given in this blog post)
[Measures].[Average Cycle Time] =
Sum(
Filter(Descendants([Issue].CurrentMember, [Issue].[Issue]),
DateInPeriod([Issue].CurrentMember.get(“Resolved at”), [Time].CurrentHierarchyMember) AND
[Measures].[Issues resolved] > 0),
([Measures].[Average workdays in transition status],
[Transition status].[Unresolved status],
[Time].CurrentHierarchy.DefaultMember)
) / [Measures].[Issues resolved]
But after I activate these user defined measure “Average Cycle Time” and member “Unresolved Status” I get an empty table for Average Cycle Time and Issues resolved. Though there are values in the average workdays in transition status.
Could you please help debug the issue here and let me know what I am missing. Appreciate your help and response.
My requirement is to get two reports.
(1) Average Time spent in individual “in progress” statuses by only the resolved tickets in a given time period.
(2) Total Cycle Time = Average of all the Time spent in individual “in progress” statuses.
Could you help here please?
LikeLike
Hello Karthiga
Yes please ignore the Warning in the calculated measure in the dimension “Transition Status”
You can try to add this Calculated Measure in “Measures”
Note the change from “Average workdays in transition” to “Days in transition status”.
With this measure you can check if the measure match with the value/time in the ticket (you will see that match).
If you show in rows “Issue” and in columns “Issue Resolution date” you will see all fine BUT
The problem is that the issues are counted in the IssueCreation date (and not in the resolution date), but you can activate in “Measures” dimension “Issues Resolved”
Regards
LikeLike
Hello,
Appreciate your quick response, I tried to follow your instructions, but still get an empty table as a result for the cycle time and the issues resolved 😦
1. I have selected the calculated member Unresolved status on the rows in the Transition Status
2. I updated the calculated measure Cycle time with what you said.
3. Selected All Issues in rows and Issues resolved in columns
4. Didn’t select the Time dimension.
Not sure what I am missing, any thoughts on next steps ?
Thank you.
LikeLike
Hello, the problem is just the point 1 (1. I have selected the calculated member Unresolved status on the rows in the Transition Status) this is not needed. Try with:
Measures must be in columns, Time (and or Issue) in rows
Regards
LikeLike
Hello,
Thank you for the inputs. It worked now. I modified the calculated measure’s formula to use Workdays in transition status instead Days in transition status.
Sum(
Filter(Descendants([Issue].CurrentMember, [Issue].[Issue]),
DateInPeriod([Issue].CurrentMember.get(“Resolved at”), [Time].CurrentHierarchyMember) AND
[Measures].[Issues resolved] > 0),
([Measures].[Workdays in transition status],
[Transition status].[All Transition Statuses],
[Time].CurrentHierarchy.DefaultMember)
) / [Measures].[Issues resolved]
Thanks again, appreciate your quick response and help 🙂
LikeLiked by 1 person
you welcome!
LikeLike
Hello,
One more question: I am trying to plot a “Time Spent in each status” chart.
The below calculated measure does not consider just the resolved issues in a given time period instead takes into account all of the issues that transitioned out of the statuses in a given time period.
[Measures].[Average days in transition status] =
CASE WHEN [Measures].[Transitions from status] > 0 THEN
[Measures].[Days in transition status] /
[Measures].[Transitions from status]
END
Could you help me formulate the logic to use this in conjunction with the below measure to iterate through the list of resolved issues only?
(Descendants([Issue].CurrentMember, [Issue].[Issue]),
DateInPeriod([Issue].CurrentMember.get(“Resolved at”), [Time].CurrentHierarchyMember) AND
[Measures].[Issues resolved] > 0),
([Measures].[Workdays in transition status],
[Transition status].[All Transition Statuses],
[Time].CurrentHierarchy.DefaultMember)
)
Thanks in advance.
LikeLike
I followed Martins instructions given in the below thread. I think that gives me the time spent in each status for all of the resolved issues in the given time period.
By creating a report with a measure “Workdays in transition status” in columns, and “Transition Status” dimension and “Issue” dimension in rows.
https://community.atlassian.com/t5/Jira-questions/EazyBI-Time-in-each-status/qaq-p/814302
LikeLiked by 1 person
Hello Again,
A go-back on the issue that I mentioned in the above thread, I modified the calculated measure’s formula to use Unresolved Status instead of All Transition Statuses.
Sum(
Filter(Descendants([Issue].CurrentMember, [Issue].[Issue]),
DateInPeriod([Issue].CurrentMember.get(“Resolved”), [Time].CurrentHierarchyMember) AND
[Measures].[Issues resolved] > 0),
([Measures].[Workdays in transition status],
[Transition status].[Unresolved status],
[Time].CurrentHierarchy.DefaultMember)
) / [Measures].[Issues resolved]
I get an empty column for the Cycle Time 😦
Any thoughts on what might be the issue.
I have Issues, Time and Transition Status (with All Transition Statuses member) selected on the Rows.
Thanks very much for your help.
LikeLike
Never mind, I figured out a silly mistake in the above measure, “Resolved” is missing an “at” 😦
LikeLiked by 1 person
Hi Karthiga, happy to know you solve the issue! 😀 best regards
LikeLike
Hi,
If I want to show the lead time on a sprint level, what should I do?
Thanks! Wenhao
LikeLike
Hi! Awesome article, thank. I have 2 questions regarding it:
1. I’m constantly getting 60-seconds timeout when trying to execute the query from article. Any ideas on optimization?
2. I have 3 done statuses: Awaiting deployment, Closed, Done. Formula will do the correct calculation when I need to calculate average lead time to any of these 3 statuses. How can I modify the formula, so I could calculate average lead time only to statuses Done and Closed? In this case [Measures].[Issues Resolved] in denominator won’t be calculated correctly
LikeLiked by 1 person
Hello Valerii,
1.- Please add this to the settings of eazyBI:
[mondrian.rolap]
queryTimeout = 120
2.- Try to add a new calculated member in TransitionStatus to have a second measure of [Transition status].[Unresolved status] and clone the other calculated member of Measures to use the new “Unresolved status” measure.
Regards!
LikeLike