eazyBI - How to set a date difference based on a custom field, not JIRA's Resolved system field

Peter Bengov
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 5, 2015

This is the code I'm using for calculating the median

Median(
  Filter(
    NonEmptyCrossJoin(
        Descendants([Issue].CurrentMember, [Issue].[Issue]), [Measures].DefaultMember),
        [Measures].[Issues resolved] > 0
    ),
  DateDiffHours([Issue].get('Created at'),
    [Issue].get('Resolved at'))
)

I'm looking to use a custom date field I have instead of the "Resolved" field. However, 2 issues with that:

  1. The custom field is a date field (doesn't save the hour).
  2. How do I change this piece of code to make this new field replace the system one.

Thanks

2 answers

1 accepted

0 votes
Answer accepted
Lauma Cīrule
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 12, 2015

Hi Peter!

The formula above is looking only at resolved issues (the filter with [Measures].[Issues resolved] > 0), but I imagine you would like to go through all issues no matter if they are resolved or not. In this case you would use the [Measures].[Issues created] > 0 instead.

If the custom field is Date Picker type (instead of Date Time Picker), and you have selected to import this field as Property, the time for Date Picker issue property will be set to that days 00:00:00 in eazyBI. You can still use this in the DateDiffHours function, but note that the hours difference will be calculated with beginning of day. Maybe instead it is better to use the DateDiffDays function that would ignore the time?

To use another Issue property instead of 'Resolved at' you can write this custom fields name in the to_date argument of function. For example, if the custom date field name in JIRA is 'Date for testing' the formula would be as follows 

Median(
  Filter(
    NonEmptyCrossJoin(
        Descendants([Issue].CurrentMember, [Issue].[Issue]),
        [Measures].DefaultMember),
      [Measures].[Issues created] > 0
    ),
  DateDiffDays([Issue].get('Created at'),
    [Issue].get('Date for testing'))
)

Please let me know if you have any additional questions. Note that you can contact me directly at support@eazybi.com

Kind regards,
Lauma 

Peter Bengov
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 24, 2015

Hey Lauma, thanks for the answer. I tried this change but it didn't get any results back. Just inserted the field name into [Issue].get('<field name>')). BTW, the field was change to a date-time custom field. Maybe there is a need to add "at"/"on" right after the field's name?

Lauma Cīrule
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 25, 2015

Hi Peter, To debug this, could you select the Issues dimension on rows and expand some project where issues have the custom date field and then from Measures / Calculated members / Issue properties select the custom date field property on columns - does it show up for issues? You can see exact property name that should be used in the above formula by clicking on edit for the Property calculated Measure. Please send me as screenshot of above report if you still experience problems after finding the Issue property with the custom date. Kind regards, Lauma

Peter Bengov
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 15, 2015

Thanks Lauma, I was able to get this working by changing the Formatting for that field's Issue Property to Data and Time (was Month Day Year before).

0 votes
Peter Bengov
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 11, 2015

@Lauma, maybe you have an idea on how to do this?

Suggest an answer

Log in or Sign up to answer